paulcraigdainty
Registered User.
- Local time
- Today, 09:24
- Joined
- Sep 25, 2004
- Messages
- 74
I'm trying to get the following code working when a form loads:
Private Sub Form_Load()
txtQ1.Value = DLookup("[Q1]", "tblQ1")
Basically the value of txtQ1 is populated with the value of Q1 in tblQ1. When opening the form the text box doesn't populate.
It's strange becasue I can get the code to work behind a check box like this:
If chkQ5.Value = True Then
txtQ5.Value = DLookup("[Q5]", "tblQ5")
Can anyone tell me why I can't get it to work on form load?
Private Sub Form_Load()
txtQ1.Value = DLookup("[Q1]", "tblQ1")
Basically the value of txtQ1 is populated with the value of Q1 in tblQ1. When opening the form the text box doesn't populate.
It's strange becasue I can get the code to work behind a check box like this:
If chkQ5.Value = True Then
txtQ5.Value = DLookup("[Q5]", "tblQ5")
Can anyone tell me why I can't get it to work on form load?