G
Guest
I'm trying to change the "Update to" in an Update query from code in the
module behind a form. I have build everything in the design view of the
Access 2000 database window and have a limited knowledge of VBA
I have Table1 with three fields, One, Two & Three. Field One is formated
for short date, field Two is a check box and field Three is formated for
text. I also have an Update query that I want to use twice in the same sub
procedure. The first time I want it to change field Two to "-1" depending on
what's in field Three. I do not want to change the date in field One this
time. Between the first & second use of the query I will append the records
to an other table. The second time I want the query to change those same
records in Table1 as follows: Field Two back to "0" and add a time interval
to field One. The time interval needs to be changeable depending on other
circumstances. The query works fine if I manually put [One] the first time
and DateAdd("yyyy",1,[One]) the second time in column one.
I've tried making a text box on a form = [One] & DateAdd("yyyy",1,[One]) and
referring to it in the query with Forms!FormName!TextBox but I get a type
conversion error.
I repeat that I'm not very knowledgable in VBA and I've had trouble trying
to use some of the code in this forum, even when I copy it directy into the
module.
Can anyone help me?
module behind a form. I have build everything in the design view of the
Access 2000 database window and have a limited knowledge of VBA
I have Table1 with three fields, One, Two & Three. Field One is formated
for short date, field Two is a check box and field Three is formated for
text. I also have an Update query that I want to use twice in the same sub
procedure. The first time I want it to change field Two to "-1" depending on
what's in field Three. I do not want to change the date in field One this
time. Between the first & second use of the query I will append the records
to an other table. The second time I want the query to change those same
records in Table1 as follows: Field Two back to "0" and add a time interval
to field One. The time interval needs to be changeable depending on other
circumstances. The query works fine if I manually put [One] the first time
and DateAdd("yyyy",1,[One]) the second time in column one.
I've tried making a text box on a form = [One] & DateAdd("yyyy",1,[One]) and
referring to it in the query with Forms!FormName!TextBox but I get a type
conversion error.
I repeat that I'm not very knowledgable in VBA and I've had trouble trying
to use some of the code in this forum, even when I copy it directy into the
module.
Can anyone help me?