darkstar257
Registered User.
- Local time
- Today, 13:24
- Joined
- Jan 6, 2011
- Messages
- 77
Each page on the main form stores information on an order in the sub-form table. So that the main form is tied to the table Item_Line by a Relationship. However, when I try to pull values from VB code, it doesn't give me all the information from this relationship. What's going on?
I created a button in the main form to grab values from the table, but it only pulls up values from the mouse cursor selected line of the table when the button is clicked. This is simply using the Forms! call out:
So then I tried to pull it up by using a Recordset and it gives me the first table item only:
And when i use a Do While loop it gets stuck in an infinite loop outputting an random item value from somewhere else on the table.
I created a button in the main form to grab values from the table, but it only pulls up values from the mouse cursor selected line of the table when the button is clicked. This is simply using the Forms! call out:
Code:
Forms![Item_Line_sub]![ID]
So then I tried to pull it up by using a Recordset and it gives me the first table item only:
Code:
Dim db As Database
Dim Lrs As DAO.Recordset
Dim LGST As String
Set db = CurrentDb()
Set Lrs = db.OpenRecordset("Item_Line")
If Lrs.EOF = False Then
LGST = Lrs("Description")
Else
LGST = "Not found"
End If
Lrs.Close
Set Lrs = Nothing
MsgBox (LGST)
End Sub
And when i use a Do While loop it gets stuck in an infinite loop outputting an random item value from somewhere else on the table.
Code:
Dim db As Database
Dim Lrs As DAO.Recordset
Dim LGST As String
Set db = CurrentDb()
Set Lrs = db.OpenRecordset("Item_Line")
Do while Not rst.EOF
MsgBox (ID)
End If
rst.MoveNext
Loop....
...