Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 2nd, 2004, 05:42 AM
JamieH JamieH is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 54 JamieH User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 2 m 28 sec
Reputation Power: 5
Question Query in msaccess - VB link

Hi,

A friend of mine asked me to do some stuff in ms access.
I created a a form (frmPeriod) in which I have a simple VB code which refers to a query defined in msaccess (Qperiod).

In the VB code I make the following statement which executes the query.

strStartdate = "20031231000000"
DoCmd.OpenQuery ("Qperiod")

The Qperiod query is defined in msaccess - hereby I want to use a criteria which uses the strStartdate value from the VB code. In the query Qperiod I make a criterium like this:

>"expr:Forms!frmPeriod!strStartdate"

The query is executed however the result is not correct. It seems that I make a wrong link with the expression (strStartDate). Does anybody know where I am going wrong?

Thanks!
Jamie

Reply With Quote
  #2  
Old February 2nd, 2004, 07:02 AM
JamieH JamieH is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 54 JamieH User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 2 m 28 sec
Reputation Power: 5
Found the problem - in the criteria field the expression must be

[Forms]![frmPeriod]![StartDate]

Cheers

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Query in msaccess - VB link


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 5 hosted by Hostway
Stay green...Green IT