nka
Waterwings inflated
- Local time
- Tomorrow, 10:50
- Joined
- Jul 11, 2005
- Messages
- 16
Hi all.
I am not very good with VBA coding and manage to get around most of what I need using wizards and converted macros.
However, I have come unstuck slightly with what I am trying to do.
I have a form with an unbound field [searchuser]. I then use the following code to open the main form filtered to match [searchuser].
However, I don't want the form to open if there are no matching records.
Can someone please guide me on how to create the necessary code to check for a valid record before opening the filtered form (based on a table) and perhaps display a message box to say "no records".
Many thanks
I am not very good with VBA coding and manage to get around most of what I need using wizards and converted macros.
However, I have come unstuck slightly with what I am trying to do.
I have a form with an unbound field [searchuser]. I then use the following code to open the main form filtered to match [searchuser].
Code:
stDocName = "SHW_UserIssues"
stLinkCriteria = "[User]=" & "'" & Me![SearchUser] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
However, I don't want the form to open if there are no matching records.
Can someone please guide me on how to create the necessary code to check for a valid record before opening the filtered form (based on a table) and perhaps display a message box to say "no records".

Many thanks