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

Save table

Status
Not open for further replies.

lous

Technical User
Mar 8, 2002
53
US
In Microsoft Access 97, how do I tell VBA to save the properties of a table I've changed?

For example, if I change the default value of a field in a table to 12345, what's the command to make it save it so that it'll always be that number (or whatever number I tell it to use in the future)?

I'm sure this is easy, but I don't know the command and don't have any books.

Thanks!
 
You could probably use
DoCmd.RunCommand acCmdSave
Be aware, however, that doing so will change the status of your version of the database to exclusive, and no one else will be able to open it until you close out.
 
Well what about saving that number into another table?

I could create a second table just to store that number, but how do I reference it from the form I'm using and update it as it changes?
 
Cool idea. Create the table with two fields: DayCreated(date datatype) and ValueToUse (same datatype as whatever the field you're updating) - you can change the field names, but watch out for field names that conflict with Access reserved words and functions, like 'Date'.
In code, when the form loads, add a new record to the table with today's date and the value you want to set it to.
Then set the default value of the field to dlookup
of that value with the criteria of DayCreated = Date().
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top