Forum: Visual Basic 4 / 5 / 6 Apr 19th, 2009 |
| Replies: 1 Views: 435 My guess is that a 'Materials' can have many 'MaterialRequisitionDetail' (1-N relationship).
Now, MaterialRequisitionOrder.requisition_no = 129 gives you a single 'MaterialRequisitionOrder'.... |
Forum: Visual Basic 4 / 5 / 6 Dec 27th, 2008 |
| Replies: 11 Views: 1,026 Your code is then ok. Assuming you do get only one record :) |
Forum: Visual Basic 4 / 5 / 6 Dec 25th, 2008 |
| Replies: 11 Views: 1,026 Your code will actually display the last record found. Instead of the loop, check that the recordset is not empty and display only one (first) record. Add "Next"-button to the form and when the user... |
Forum: Visual Basic 4 / 5 / 6 Dec 24th, 2008 |
| Replies: 11 Views: 1,026 Yes, a bit confusing. Without seeing the "big picture", I would allow user make the selection criteria in the first form. When user presses the button I would build a new SQL select statement with... |
Forum: Visual Basic 4 / 5 / 6 Nov 19th, 2008 |
| Replies: 8 Views: 1,388 Ok. Here's a snippet from the code I'm using now:
Set oConn = New ADODB.Connection
ConStr = "PROVIDER=SQLOLEDB;Data Source=XXX; INITIAL CATALOG=XXXlab; User ID=XXX; Password=XXX;"
oConn.Open... |
Forum: Visual Basic 4 / 5 / 6 Nov 19th, 2008 |
| Replies: 8 Views: 1,388 Then I'll refer to my first reply. At the point of error, what values does
oConn.Errors(0).NativeError
oConn.Errors(0).Description
have? oConn is your connection object. Also what type of... |
Forum: Visual Basic 4 / 5 / 6 Nov 18th, 2008 |
| Replies: 2 Views: 865 You must double double quotes inside double quotes:
LoadCommand = "(load \""S:\Tools\Tools_Subfolder\MyStuff\test.txt \"")" |
Forum: Visual Basic 4 / 5 / 6 Nov 18th, 2008 |
| Replies: 8 Views: 1,388 I see. I wasn't aware of that.
However, the article suggested a solution that should solve the problem. This is, if I did understood it right. Update MDAC (latest version is 2.8) and use a... |
Forum: Visual Basic 4 / 5 / 6 Nov 17th, 2008 |
| Replies: 8 Views: 1,388 Do you need adorset.Move 0 ?
However, you do have a connection object. Check from the connection object which is the native error and description
oConn.Errors(0).NativeError... |
Forum: Visual Basic 4 / 5 / 6 Nov 2nd, 2008 |
| Replies: 2 Views: 812 You have to loop the original string:
Private Function InsertChar(ByVal StringIn As String, _
ByVal CharToInsert As String, _
ByVal InsPosition As Integer) As String
Dim NewString As... |
Forum: Visual Basic 4 / 5 / 6 Oct 17th, 2008 |
| Replies: 3 Views: 1,068 Hi! If your question is solved, please mark the thread as solved. Thank you! |
Forum: Visual Basic 4 / 5 / 6 Oct 14th, 2008 |
| Replies: 11 Views: 1,090 smile4evr said there are also combo boxes. Could the validation fail with combos? |
Forum: Visual Basic 4 / 5 / 6 Oct 14th, 2008 |
| Replies: 11 Views: 1,090 No. None of them is a complete solution and nobody can give one without seeing the whole code.
There may be a just a little spot everyone's missed. Can you give more details?
But few things to... |
Forum: Visual Basic 4 / 5 / 6 Oct 13th, 2008 |
| Replies: 3 Views: 1,068 Here you are:
Dim LoanDate As Date
Dim LoanDays As Integer
Dim DueDate As Date
Dim DiffDays As Long
Dim Fine As Single
Dim Total As Single
' When loaned |
Forum: Visual Basic 4 / 5 / 6 Oct 12th, 2008 |
| Replies: 3 Views: 544 Your school assignment states clearly what you should do:
Private FuelLevel As Double
Private Sub Class_Initialize()
FuelLevel = 0
End Sub
You can't initialize variables outside of the... |
Forum: Visual Basic 4 / 5 / 6 Oct 12th, 2008 |
| Replies: 11 Views: 1,090 Submit or Ok-button is the proper place to validate input. Since you have many things to validate, I would use a separate function:
Private Function ValidateForm() As Boolean
' Validate form... |
Forum: Visual Basic 4 / 5 / 6 Oct 7th, 2008 |
| Replies: 6 Views: 5,082 Sorry :sweat: Right$ instead of Left$...
Private Function HexString(EvalString As String) As String
Dim intStrLen As Integer
Dim intLoop As Integer
Dim strHex As String
EvalString =... |
Forum: Visual Basic 4 / 5 / 6 Oct 7th, 2008 |
| Replies: 2 Views: 693 What error message exactly?
Do you have CN open?
Dim CN As ADODB.Connection
CN = New ADODB.Connection
CN.Open "<connection string>"
Also the recordset could be empty:
If RS.Fields.Count > 0... |
Forum: Visual Basic 4 / 5 / 6 Oct 7th, 2008 |
| Replies: 6 Views: 5,082 I see. Here's a Q&D solution:
Private Function HexString(EvalString As String) As String
Dim intStrLen As Integer
Dim intLoop As Integer
Dim strHex As String
EvalString = Trim(EvalString)... |
Forum: Visual Basic 4 / 5 / 6 Oct 7th, 2008 |
| Replies: 2 Views: 1,502 By default, yes. Unless you have Option Compare Text
Here's an example
Dim str As String
str = "ABC"
str = Replace(str, "b", "x", , , vbBinaryCompare)
results "ABC" and vbBinaryCompare is the... |
Forum: Visual Basic 4 / 5 / 6 Oct 6th, 2008 |
| Replies: 6 Views: 5,082 In what way it's not working properly?
I tried:
Dim strOut As String
strOut = HexString("ABC")
and strOut was " 41 42 43" which is correct. |
Forum: Visual Basic 4 / 5 / 6 Sep 30th, 2008 |
| Replies: 1 Views: 615 Month has to be in upper case:
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "dd/MM/yyyy" |
Forum: Visual Basic 4 / 5 / 6 Sep 23rd, 2008 |
| Replies: 4 Views: 1,200 :$ This is VB6, not VB.NET, sorry. Let's try again...
' Get current date
Label1.Caption = Now
' User enters number of days in the TextBox. Lets say 8 days
Text1.Text = "8"
' Now calculate... |
Forum: Visual Basic 4 / 5 / 6 Sep 23rd, 2008 |
| Replies: 4 Views: 1,200 Do you mean something like this:
' Get current date
Label1.Text = System.DateTime.Now.ToString
' User enters number of days in the TextBox. Lets say 8 days
TextBox1.Text = "8"
' Now calculate... |
Forum: Visual Basic 4 / 5 / 6 Sep 18th, 2008 |
| Replies: 3 Views: 759 There are a few points that could cause error:
- change Dim rs As adodb.Recordset to Dim rs As New adodb.Recordset
- make sure that CN is not nothing eg. you do have a valid connection object
-... |