OnLoad query criteria problem

bonmot.srf

Registered User.
Local time
Yesterday, 21:49
Joined
May 26, 2010
Messages
11
I have a query which is the record source for a form, this query references an unbound text box txtFieldID.

SELECT tblTrials.FLD_ID AS FieldID, tblTrials.PRNUM AS prnum, IIf([prnum] Like "A*",Mid([PRNUM],2,5),IIf([prnum] Like "b*",Mid([PRNUM],2,5),[prnum])) AS prnum_num
FROM tblTrials
WHERE (((tblTrials.FLD_ID)=[form]![frmFieldIDTest]![txtFieldID]));

I have the following events on load and update:

Private Sub Form_Load()
txtFieldID.SetFocus
End Sub

Private Sub txtFieldID_AfterUpdate()
Me.Requery
End Sub

I've used this technique successfully in the past but now on form load Access prompts for the txtFieldID parameter instead of allowing the form to supply it? I've tried too many different ways from sunday around this to no avail. Any ideas?

Thanks...
 
Don't know if this is important but on my database we use [Forms]!... rather then [Form]!...
 
Don't know if this is important but on my database we use [Forms]!... rather then [Form]!...

Good spotting - that is indeed the correct usage [Forms]! instead of [Form]!
 

Users who are viewing this thread

Back
Top Bottom