simeon_rose
Registered User.
- Local time
- Today, 08:38
- Joined
- Nov 4, 2000
- Messages
- 34
hi, i've got a text box in a form and i want this textbox to generate a value from a table that the form it is on is not assigned to. i've been told to use DLookup and have read the 'bible', looked at help and still don't know what i'm doing. i want it to show the most recent addition to a field called Mini ID in table called tblcar. this is what i've got
Private Sub Mini_ID_Click()
Dim varX As Variant
varX = DLookup("[Mini ID]", "tblcar", "[Mini ID] = 1")
End Sub
now, obviously this is wrong (although it doesn't generate a syntax errot) because it does nothing at all. first of all, i don't want it to operate when it is clicked, i want it to just happen anyway, secondly the form opens with a 0 in the box, and then when the box is clicked it stays as 0.
please help a person who used to consider himself fairly intelligent, but has been demoted to the rank of 'complete idiot' and is in desperate (and urgent) need of real help.
Private Sub Mini_ID_Click()
Dim varX As Variant
varX = DLookup("[Mini ID]", "tblcar", "[Mini ID] = 1")
End Sub
now, obviously this is wrong (although it doesn't generate a syntax errot) because it does nothing at all. first of all, i don't want it to operate when it is clicked, i want it to just happen anyway, secondly the form opens with a 0 in the box, and then when the box is clicked it stays as 0.
please help a person who used to consider himself fairly intelligent, but has been demoted to the rank of 'complete idiot' and is in desperate (and urgent) need of real help.