Ozzboss
New member
- Local time
- Today, 20:36
- Joined
- Mar 11, 2022
- Messages
- 19
Hi guys!
My question for this week is... lol
I have created a text box in my main screen/form to enter a quote number and then created a button to start a search for that quote number. This in turn opens a form to be able to edit that specific quote.
I have also added an error message if the button is clicked with no quote number entered in the text box.
All this works great BUT, I would like it to also display a message when the quote number for the search is not found. At the moment it simply opens the form to a new record. I want to stop the form from opening and display this error instead. Can anyone give me a guide on how to achieve this?
The image attached shows the query that is the source of the EditQuote form.
My question for this week is... lol
I have created a text box in my main screen/form to enter a quote number and then created a button to start a search for that quote number. This in turn opens a form to be able to edit that specific quote.
I have also added an error message if the button is clicked with no quote number entered in the text box.
All this works great BUT, I would like it to also display a message when the quote number for the search is not found. At the moment it simply opens the form to a new record. I want to stop the form from opening and display this error instead. Can anyone give me a guide on how to achieve this?
Code:
Private Sub EditQuoteBtn_Click()
If Not IsNull(Me.QuoteSearchTxt) Then
DoCmd.OpenForm "EditQuote"
Else
MsgBox MESSAGETEXT, vbExclamation, "Please Enter The Quote Number You Wish To Edit"
End If
End Sub
The image attached shows the query that is the source of the EditQuote form.