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 gkittelson 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 update field in table without object on form?

Status
Not open for further replies.

bradmaunsell

Programmer
May 8, 2001
156
US
This seems like a simple thing in Access 97 but....

I have a form with a data source table named CLAIMS.

The form has an assortment of fields from the CLAIMS table that are bound to the table and the operator enters info into these fields.

When finalizing the new record, I want to have some vba code to write today's date a field named DateEntered.

The DateEntered is not on the form.

I that know I can place it on the form and hide it to accomplish above. That is "Me.DateEntered=Now()" But, can I accomplish this update without having the field on the form?

The reason is that I actually have 12 fields to write (without operator input) upon finalizing the adding of the new record.

Thanks,
Brad
South Burlington, VT
 
What is wrong with the hidden field value being set to int(now()). I use int to cut the odd time off. The fract to the right of the decimal is time.

rollie@bwsys.net
 
Hiya bradmaunsell,

I'm still looking for a definitive answer on this, but I've been messing about with another question on Tek-Tips regarding subforms and certain fields having to be painted on the form as you suggest.

I did prove to myself that I need only the table name as the recordsource to be able to refer to fieldnames in any of the forms (even when referring to fieldnames on a subform from an external form).

I could refer to and update fields in a table even though they weren't painted on any form/subform and the form recordsource for all forms was just the table name.

I have found (along with many others) that after struggling with a problem for days - simply painting the pk or fk on a form resolves a stupid field reference problem. Maybe I had a query that selected part of the table only - but this doesn't sound right because if I didn't 'SELECT' the PK why should painting it help?

Do you actually 'SELECT' the field in the query that populates the form? If not - include it.
If you are using the TABLE name as the recordsource - God knows.

Hope someone else looks at this post - gimme a definitive answer plsssssssssss - never mind bradmaunsell!

Regards,

Darrylle





"Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top