|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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 |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Two Paramters passed to a form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|