A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

SQL



 
 
Thread Tools Display Modes
  #1  
Old November 30th, 2006, 06:44 PM posted to microsoft.public.access.queries
Klatuu
external usenet poster
 
Posts: 7,074
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.