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

Default value for a field in a query

Status
Not open for further replies.

Beatrix

Technical User
Feb 11, 2002
3
0
0
GB
Hi, I've created a form off a query (querying that a field = yes), but need when adding a new record for it automatically to fill in a yes in this field (so that it is included in the query).

This ideally needs to happen if creating a record on the datasheet or on the form, but not when adding a record on the main table the query is sourced from.

 
Hi,
Beatrix

If you set the default value for that particular field in the table where the data will be entered to Yes.

This will solve your problem.

Note you can only add records to a signal table at anyone time via data entry through a query within a relational database.

If you have any further queries please do not hesitate to contact me.

HoleInTheFoot
 
I'm not sure that this is the solution - or I haven't understood.

If I set the default value in the table to be yes - this will happen for every record.

Let me give an example, say I have a whole database of contacts and a field (a tick box) labelled supplier. I have a query selecting all those records that are suppliers. When I am working in this query (whether the datasheet view or the form view), I want to be able to add a new record, and for it to automatically tick the suppliers box.

There will be other records that I will create in other forms that will not want a default value set to yes for suppliers, so can't set the default for the table the query is selected from.

Any advice?....
 
Hi,
Beatrix

I assumed the field was a mandatory field, thus it requires a y or n to be populated.

If this is not the case then reply asap, and I should be able to provide a different solution.

HoleInTheFoot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top