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!

Lock a date in a form

Status
Not open for further replies.

aliceapraham

Technical User
Apr 9, 2007
38
US
Hi,
I have a form that has a date in it =Date()
& i want to lock it, as whenever i open the form I don't want it to give me today's date, I just want it to give me the date that it was formed that page.
Like I opened a new records today, so it will right today's date, but then totmorrow when i open the same record, i don't want it to change to today's date, i want it to show yesterday's date (as it was created).
pls help.
thank you
Alice
 
You will need to add a Created date and, perhaps, an Updated date to your table. Instead of a control set to =Date(), set the default value for Created date to =Date(). For Updated date to work, you will need to add some code.
 
What I understood is that it will be 2 dates fields, right? but i only want one field that doesn't change after i put the date in it, (actuallly i want the date to be put my the computer not the user).
but pls will u tell me what is those codes.. it might help me understand more.\
thanks
Alice
 
An updated date was only a suggestion. Go with the created date for now, if that works, you can consider whether you want to show an additional date.
 
ok got u, but when I'm hooking it up in the control source with the date in the Ordertable, it's giving me #Name? error
I don't know why.
any suggestions? I know I'm doing something wrong.
Alice
 
Did you type in the name or select it from the list of available fields? Is your form based on a query? If so, you may need to update it to show the new field.
 
actually my form is not based on anything , it has several field from several tables, & I want to bound it to drop couple of their fields in a specific table (which i couldn't).so the date field is stande alone thing, which actually i have a field in the order table i can link it to, but it's still not working, so any help????
thanks.
Alice
 
Does your form have a Record Source? Is the new field part of the Record Source?
 
Yes, it has but it's grabbing from one table only, which is the product table. But i also have fields in it that's grabbing from the customer & employee tables, (is that wrong).
LAice
 
SELECT PriceTable.PriceID, PriceTable.Service, PriceTable.Price1, PriceTable.Price2, PriceTable.Price3, PriceTable.Price4 FROM PriceTable;
This is my Record Source of my form
 
So how are you getting data from the Customer and Employees table? And why is the date in the Order table relevant?
 
I have a combobox for customer that has a Row Source:
SELECT [Customers Query].CompanyName, [Customers Query].BillingAddress, [Customers Query].City, [Customers Query].StateOrProvince, [Customers Query].PostalCode, [Customers Query].FirstName, [Customers Query].LastName FROM [Customers Query];
& i have txt boxes that puts the data according whatever customer i picked from the combobox (I coded them in VB).
& don't ask me why the date is not working casue i really don't know (& actually that IS my question)...hahahah
thanks again
Alice
 
That is quite a different thing to getting a date from the Order table to be relevant to the PriceTable. If you wish to include a date in the manner you mention in your first post, you will need to add a date field to the Price table, as I advised in my first post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top