Enter the default value of a field per project

Sniper-BoOyA-

Registered User.
Local time
Today, 10:31
Joined
Jun 15, 2010
Messages
204
Good Morning,

Ive got a table which stores information for each sample that will be processed in our testlab.

One of the fields is "diameter". Even though the diameter isn ot always the same, the same diameter will be used within each project.

Example:

So in project A it can be 150,7 and project B it can be 160,9

My question:

I know u can set up default values of a field in a table, is it possible to give the user the opportunity to enter a default value?

cheers!!
 
I'm not sure if you can code the default value for a table field, butyou could use an update query with a parameter in it maybe? Just put
Code:
[Enter Diameter for Project]
in the criteria of the update query and it'll update the field with whatever the user enters. If you're calling the query from a form you could also have a criteria such as
Code:
forms!formname.form!controlname.value
To make sure it's updating the right project.
 
Thanks for the fast reply.

The thing is, when i do use a update query with the criteria and such, and i have a total of 6 samples.

It will ask for the diameter value 6 times.

And when make a query which looks at a value of a textbox on the form, then the form would have to be active at all times due to the fact that the value isnt stored anywhere.

Am i right?
 
It shouldn't ask you 6 times - if you say WHERE Project = forms!.... it should work OK. The way to check if it's going to update the right rows is to run a select query to start with, and if it brings back the 6 results you're looking for, the update query will run on all of them without asking for the parameter more than once.

If the form isn't open, correctomundo, it'll throw up an error. The way to get around that is to (a) have the form open and update it then, or (b) to have the project number/name stored in a global variable, then just use the variable name as the criteria instead of the form reference.
 

Users who are viewing this thread

Back
Top Bottom