If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
SQL
I assume you are in a form, but you did not say what you would do to initiate
the search, so I am guessing you will be entering the customer ID in a text box on the form. Use the Before Update event of the text box and a DLookup using your query to determine whether the customer ID is in the recordset: If IsNull(DLookup("[Customer ID]", "QueryNameHere", "[Customer ID] = & Me.txtCustomer)) Then If MsgBox("Do you want to add this new customer", vbQuestion + vbYesNo, "Customer Not Found") = vbYes Then Docmd.OpenForm "CustomerDataEntry" Else Cancel = True End If "Ramtin" wrote: I have query, finding customers based on customer ID, What I can not do is when there is no record on my table meaning the customer is new i want access to show this message " No record was found, do you want to enter a new custmoer" and after clicking yes I want access to direct to data entry form. cn you help me with writing SQL for this |
Thread Tools | |
Display Modes | |
|
|