NigelShaw
08-20-2008, 08:12 AM
Its OK, i dont have any exciting news about new positions given to users unfortunately, just a problem thats all. but hey, with all of these new "in charge " people, isnt it great?
seriously,
a straight forward issue.
My query has the following fields
MonthNum ( number )
CurrentPeriod ( yes/No )
its work is simple. MonthNum criteria is set to forms!mainform!monthnumtxt
( this is currently showing as 9 as it is this month 8 + 1 to get the next month number )
when the form is open, i can run the query and get the tickbox. i can tick the tickbox, close the query and the value is saved.
i want to automate this from a button which will select the next period.
Set db = CurrentDb
Set rs = db.OpenRecordset("UpdateMonthQry", dbOpenDynaset)
rs.Edit
rs!CurrentPeriod = True
rs.Update
this will not update the query. any reason why?
alternatively, i could update the table but im not sure how to filter this to the number in the text field.
could this even be updated via SQL
Select CurrentPeriod From UpdateMonthlyQry Where Forms!mainform!textbox
but im nto good with SQL
my vb is right. right?
thanks,
Nigel
seriously,
a straight forward issue.
My query has the following fields
MonthNum ( number )
CurrentPeriod ( yes/No )
its work is simple. MonthNum criteria is set to forms!mainform!monthnumtxt
( this is currently showing as 9 as it is this month 8 + 1 to get the next month number )
when the form is open, i can run the query and get the tickbox. i can tick the tickbox, close the query and the value is saved.
i want to automate this from a button which will select the next period.
Set db = CurrentDb
Set rs = db.OpenRecordset("UpdateMonthQry", dbOpenDynaset)
rs.Edit
rs!CurrentPeriod = True
rs.Update
this will not update the query. any reason why?
alternatively, i could update the table but im not sure how to filter this to the number in the text field.
could this even be updated via SQL
Select CurrentPeriod From UpdateMonthlyQry Where Forms!mainform!textbox
but im nto good with SQL
my vb is right. right?
thanks,
Nigel