|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
VBA for Boolean query, HELP!!
Hi, Im struggling with some code, i want a query to run after i have clicked off a textbox on a userform. So first of all i used the OnExit property of the textbox on the userform, and then used vba to hopefullly perform what i want to happen. The code i used is:
Private Sub Departure_Exit(Cancel As Integer) If DoCmd.OpenQuery(Qrydepdes) Then Exit Sub Else DoCmd.OpenForm (FrmNewJourney) End Sub I need the query to give the result as yes there are results or no there isn't results. and this code brings up the error to do with the .OpenQuery part. don't know what to do! It comes up with a Compile error, expected function or variable. Thanks for any help!! |
|
#2
|
|||
|
|||
|
This is probably the wrong forum, seeing as it's for .Net
I'm guessing this is a Select query? Anyway, DoCmds don't return a result from queries that way. They're usually used to run action queries - Insert, Update, Delete, etc. You'll probably have to write your query in code, then examine the result. What is the query? |
|
#3
|
||||
|
||||
|
Once you run the query your going to need to use an object to extract the data, however I don't know how to do this in VBA.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > VBA for Boolean query, HELP!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|