.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 24th, 2004, 06:49 AM
cjr_chris cjr_chris is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 7 cjr_chris User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!!

Reply With Quote
  #2  
Old March 4th, 2004, 03:08 PM
salvelinus salvelinus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 24 salvelinus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #3  
Old March 4th, 2004, 10:58 PM
adurstew's Avatar
adurstew adurstew is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Charlotte, NC
Posts: 114 adurstew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 33 sec
Reputation Power: 7
Send a message via AIM to adurstew Send a message via Yahoo to adurstew
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.
__________________
Andrew J Durstewitz
ASP.NET,VB.NET,SQL Developer

http://madashellnc.blogspot.com

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > VBA for Boolean query, HELP!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT