S
Steve Moody
Does anyone know how to set the criteria for a query using visual basic
code? Thanks!
Steve
code? Thanks!
Steve
-----Original Message-----
OK, then I would do the following in the On Click event of
your Command Button that you created to close Form1. Make
sure you add this code before your code to close form1.
DoCmd.OpenForm "Form2",acNormal,,"[YourIDField]=
ME.YourIDField"
Basically you will be using the WHERE clause of the
OpenForm action.
Hope this helped.
ET Sherman
I've-----Original Message-----
I am using two forms. There will be times when the user will be looking at a
record on form1 and will want to switch to form2, so
provided a buttoncouldto close the form1 and open form2. However, when the switch occurs, I want
form2 to open up with the same record that the user was working on in form1.
To accomplish this, I thought it would be easy if I
open a query, setopens,the criteria for the ID field to the open record in form1, and then set that
query as the source for form2. That way when form2
it will use the.query as it's source and the query will only contain the one record with the
same ID number. Does that make sense?
I can get form2 to open and I can set it's RecordSource to use a query. I
just can't figure out how to set the query to use the ID number as it's
criteria.
Thanks!
Steve
.