G
Guest
I have a form built on a temporary table which is using Year/Period to
differentiate between records. On accessing the form the current period data
is displayed (uses a varwhere statement containing the year and period values
created in a pop-up form to then call this form).
At the bottom of the form I have 10 command buttons, one for the current
period and one for the 9 preceeding periods. When pressing one of these
buttons the intention is to display the releveant data for that period. The
code inside each button builds the varwhere statement with the selected
period and then issues a Me.Requery. This does not populate the data as I
intended.
First problem I have encountered is that a 'Calculating ....' message is
displayed at the bottom of the Access screen - not seen this before,and
nothing I have invoked in the form should be causing this to happen as far as
I am aware. This appears to stall the screen and I need to move focus out of
the form (to the internet or something else) and then back into the form to
action anything on the screen (scrollbar etc).
Second problem is that the requery doesn't call the data up correctly, just
leaves the data as for the original varwhere entry from the popup. I have
missed something out or I am not applying the correct logic somewhere but
cannot see the wood for the trees so to speak.
Code used in Command button On Click is shown below :-
intYear = GetYear(1)
intPeriod = GetPeriod(1)
varwhere = "ztblA.Period = " & intPeriod & " AND ztblA.Year = " & intYear
Me.Requery
'DoCmd.ApplyFilter , varwhere (tried this as well)
GetPeriod calculates the filtered original value sent to the form minus the
value in quotes. GetYear checks for a change in year (only occurs when near
start of Financial year). Both use simple IF statements only to return values.
Comments, help or info gladly appreciated.
Cheers,
Steve
differentiate between records. On accessing the form the current period data
is displayed (uses a varwhere statement containing the year and period values
created in a pop-up form to then call this form).
At the bottom of the form I have 10 command buttons, one for the current
period and one for the 9 preceeding periods. When pressing one of these
buttons the intention is to display the releveant data for that period. The
code inside each button builds the varwhere statement with the selected
period and then issues a Me.Requery. This does not populate the data as I
intended.
First problem I have encountered is that a 'Calculating ....' message is
displayed at the bottom of the Access screen - not seen this before,and
nothing I have invoked in the form should be causing this to happen as far as
I am aware. This appears to stall the screen and I need to move focus out of
the form (to the internet or something else) and then back into the form to
action anything on the screen (scrollbar etc).
Second problem is that the requery doesn't call the data up correctly, just
leaves the data as for the original varwhere entry from the popup. I have
missed something out or I am not applying the correct logic somewhere but
cannot see the wood for the trees so to speak.
Code used in Command button On Click is shown below :-
intYear = GetYear(1)
intPeriod = GetPeriod(1)
varwhere = "ztblA.Period = " & intPeriod & " AND ztblA.Year = " & intYear
Me.Requery
'DoCmd.ApplyFilter , varwhere (tried this as well)
GetPeriod calculates the filtered original value sent to the form minus the
value in quotes. GetYear checks for a change in year (only occurs when near
start of Financial year). Both use simple IF statements only to return values.
Comments, help or info gladly appreciated.
Cheers,
Steve