Button to open form and filter

theinviter

Registered User.
Local time
Today, 12:43
Joined
Aug 14, 2014
Messages
268
Dears;
I have a form which has a button, upon clicking on the button, ten wanna open another form and filter record to 2 criteria,
But if no record then open new record and copy the "Item Code1" to " Item Code" in the new form. so i tried this code to open and filter but not working.
so please any help and guideance.
Item code is text field
Private Sub Command717_Click()
DoCmd.OpenForm "Clinic_Response", acNormal, " [Item Code] = '" & Me.[Item Code1] & "' and [Clinics_Location] = " & Me.Location_Code
End Sub
 
don't use filter, so put 3 commas for the where:

DoCmd.OpenForm "Clinic_Response", , , " [Item Code] = '" & Me.[Item Code1] & "' and [Clinics_Location] = " & Me.Location_Code
 
thanks that's work,
but i need , Afetr opening
1- filer as above (Done)
2- if no record found , then copy the item code form current record " MRN Query1" to new record on "Clinic_Response" .
 

Users who are viewing this thread

Back
Top Bottom