Hello all,
I have an application in Access-2000 with more than 20 forms.
Many of the forms are query based. Some queries are generated as soon
as the Application's authorization is verified - I use the ADODB way
to generate the queries. Some others are generated just before a form
is Opened or Loaded.
The flow of the application is as follows:
Form 1 - Main Switchboard - I verify the user's authorization.
Form 2 - Selection Menu - I allow the user to choose a State Code (MD,
NJ, etc)
Form 3 - City Selection Menu - Based on the state code chosen - I
display a list of cities in a drop down box for the user to choose.
Once the user has been determined to be authorized, there is no involvement of Form 1 in the problem I am about to describe:
This is what I observe (and which I cannot explain) :
On Form 2 I choose NJ. I am shown a set of cities on Form 3.
I close Form 3 and once again choose NJ on Form 2. This time I see a
set of cities which I know are of NJ.
Now I close Form 3 again and this time I choose MD on Form 2. I
continue to see the cities of NJ.
I close Form 3 and choose MD A SECOND TIME. Only THIS TIME, I see the
cities of MD.
Now if I close Form 3 and choose a different state, say DE, I continue
to see MD Cities.
To Generalize: Only when I choose a state A SECOND TIME do I see the cities of that state.
The query which is behind Form 3 is a ADODB Query in cat.views and is
named "Form_3_Query_1" and which is assembled on the fly in the On
Load Event Procedure of Form 3. The value of MD, or NJ or DE or any
state code chosen on Form 2, gets loaded into a global variable which I use in the "WHERE" statement of the assembled Query String as follows:
"WHERE (tblcities.state_code = " & chr$(34) & <global_variable_state_code> & chr$(34) & "));"
FYI chr$(34)is the double Quotes.
I am guessing that it could be solved with an appropriately placed "Requery" statement but am not sure whether as also where
specifically.
Thanks in advance.
Cheers!
Uttam
I have an application in Access-2000 with more than 20 forms.
Many of the forms are query based. Some queries are generated as soon
as the Application's authorization is verified - I use the ADODB way
to generate the queries. Some others are generated just before a form
is Opened or Loaded.
The flow of the application is as follows:
Form 1 - Main Switchboard - I verify the user's authorization.
Form 2 - Selection Menu - I allow the user to choose a State Code (MD,
NJ, etc)
Form 3 - City Selection Menu - Based on the state code chosen - I
display a list of cities in a drop down box for the user to choose.
Once the user has been determined to be authorized, there is no involvement of Form 1 in the problem I am about to describe:
This is what I observe (and which I cannot explain) :
On Form 2 I choose NJ. I am shown a set of cities on Form 3.
I close Form 3 and once again choose NJ on Form 2. This time I see a
set of cities which I know are of NJ.
Now I close Form 3 again and this time I choose MD on Form 2. I
continue to see the cities of NJ.
I close Form 3 and choose MD A SECOND TIME. Only THIS TIME, I see the
cities of MD.
Now if I close Form 3 and choose a different state, say DE, I continue
to see MD Cities.
To Generalize: Only when I choose a state A SECOND TIME do I see the cities of that state.
The query which is behind Form 3 is a ADODB Query in cat.views and is
named "Form_3_Query_1" and which is assembled on the fly in the On
Load Event Procedure of Form 3. The value of MD, or NJ or DE or any
state code chosen on Form 2, gets loaded into a global variable which I use in the "WHERE" statement of the assembled Query String as follows:
"WHERE (tblcities.state_code = " & chr$(34) & <global_variable_state_code> & chr$(34) & "));"
FYI chr$(34)is the double Quotes.
I am guessing that it could be solved with an appropriately placed "Requery" statement but am not sure whether as also where
specifically.
Thanks in advance.
Cheers!
Uttam