Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I reset the value of a field in a query after it is run

Status
Not open for further replies.

nancylynn

Programmer
Apr 16, 2002
9
US
How do I reset the value of a field? I am using TransferText and after it exports, I want the value of a field to be reset (yes/no). I need it to go back to no for all records.
 
How many of these controls do you have on your form?

If it is a lot, then you could cycle through the controls collection, & assuming you have named the controls logically you should be able to reset them based upon a few rules.

If there are only a few controls then you could manually reset each control... James Goodman
 
You might be able to say, in query design, <field name>: 'No' or, in SQL design, 'No' AS <field name>. Haven't done this with strings, so I don't know for sure if it works.
 
HI James,
Thanks for the help. How do I manually reset each control??? I only have one and it's called &quot;Modified&quot;. Please help.
 
You must obviously click a command button to invoke TransferText. In the command button Click event merely:

Me.Modified = Null

Or even set some criteria for it to null to. If the TransferText is successful then set it to null.

Steve King Growth follows a healthy professional curiosity
 
Now I get nothing when I export. I want it to export all of the fields of the modified record in the table. I have this for the On Click of &quot;modified&quot; field:

Private Sub Modified_Click()
Me.Modified = &quot;Null&quot;
End Sub

Now nothing exports. Thanks so much for taking the time to help.
 
You are missing the export code.
All that will happen with the code you have posted is it will reset the Modified field to null.
You are also setting it to a string called 'null', rather than assigning it null. You need to remove the inverted commas to assign null to the field... James Goodman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top