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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query by textbox entry? 1

Status
Not open for further replies.

DBLoser

MIS
Apr 7, 2004
92
US
I have a table with a field called RptPeriod. I have a form with a textbox (Date_txt). The user enters a value (text format, ex. 2005.MAY) and clicks a button to update all records within the table. I tried creating an update query and in the Update To box entering the following.

[forms]![main]![date_txt]

Here's the SQL:

UPDATE Final SET Final.[RptPeriod] = [Forms]![main]![date_txt];


I run the query and it updates the proper field in the proper table but it just blanks all of the RptPeriod instead of inserting the value in the Date_txt textbox on my form called Main. The form is open when I do this and there is an entry in the textbox. Any ideas?

Thanks,

Bruce
 
It may just be a refresh issue. Try doing a form refresh before running the query.

Hope this helps.

OnTheFly
 
You're absolutely right. I have a button that cleans the tables, imports and runs about 6 queries. After I click that button the query works properly.

Thanks a ton,

Bruce
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top