resetting query parameter used in combo box

madEG

Registered User.
Local time
Today, 14:36
Joined
Jan 26, 2007
Messages
307
Hello Folks,

I have a combo box that takes a query for its values.

When I pop the combo box, it asks me for a value/parameter (which I input with a barcode scanner).

Works fine, and returns the record I want. :)

But, I can't figure out how to remove/reset that parameter value so I can, after saving/inserting the new record, hit that drop down again on the form, and again be prompted for a new value.

I tried adding a button that, OnClick did the following:

Private Sub btnChooseAnotherDrive_Click()
Me.Scan_Serial_Number_Now.Value = Null
End Sub

...but no joy... The debugger yells at me...

Can someone tell me how to reset a parameter for a query in this case?
 
ok, I tried adding a text box with the same name as the parameter name ("Scan_Serial_Number_Now") and setting it =Null when a button is pressed, but it seems then the query is reading that to be blank, and not null, as the query does not re-prompt me to enter a parameter value.

Thoughts?
 
Ok, I figured it out. :)

I added two lines after update event:

Private Sub Form_AfterUpdate()
cboDriveID = 0
cboDriveID.Requery
End Sub

...This then forced the parameter to be asked again... duh. :)

I thought I tried this... but I guess I didn't.
 

Users who are viewing this thread

Back
Top Bottom