Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

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 ASP Free Forums Sponsor:
  #1  
Old February 13th, 2004, 12:03 AM
lyle@klovstad.c lyle@klovstad.c is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 lyle@klovstad.c User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Two Paramters passed to a form

I have a form with a command button on and when pressed it needs to open a new form, passing the information on the first form to the query that is associated with the other form. The problem is that there is two fields that need to passed. All examples only show passing one value between forms. This is the code that I am working with.

stDocName = "Enter Alumni Data"
stLinkCriteria = "[School]=" & "'" & Me![SchoolP] & "'" & "[Year] = " & "'" & Me![YearP]

DoCmd.OpenForm stDocName, , , stLinkCriteria

The error is

Syntax error (missing operator) in querry expression '[School]='Anoka'[Year]='1973'

Also do I need to have the prompt fields in the query for the second screen

Reply With Quote
  #2  
Old February 13th, 2004, 08:13 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 280 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 15 m 10 sec
Reputation Power: 6
you have missed the 'and' operator
It should be like this
stDocName = "Enter Alumni Data"
stLinkCriteria = "[School] = '" & Me![SchoolP] & "' and [Year] = " & Me![YearP]

DoCmd.OpenForm stDocName, , , stLinkCriteria


Also do I need to have the prompt fields in the query for the second screen[/QUOTE]


Instead you can base the second screens Recordsource property some thing like this "Select * from tablename where school = '" & Forms!Parentformname!![SchoolP] & "' and [Year] = " & Forms!Parentformname!![Year]

and open the form from first form like docmd.openform "secondform"
__________________
V.Subramanian

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Two Paramters passed to a form


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