View Full Version : Default Value in a Form


tamravnu
03-27-2002, 07:39 AM
I have an EXCEL spreadsheet of over 3,000 email addresses that I imported into a form in access. I set up a combo/list box called "Status" with the values of "free trial" and "unsubscribed". I wanted all the records to be set to "free trial" by default but I also need to be able to go in to each record individually and set certain one's to unsubscribed (when they choose to unsubscribe) without changing ALL of the records.

Any suggestions?

Fizzio
03-27-2002, 07:48 AM
Use an update query to set all of the values to free trial. Create an update query with the field you want to update and in the update to type "free trial" then run the query (assuming that you use a value list with only "free trial" and "unsubscribed" in the combo with no ID field).
To set the combo default value for new records, In the properties of the combo, set the Default Value to =[NameOfCombo].ItemData(0) where 0 is the first value in your list.

HTH

tamravnu
03-27-2002, 08:58 AM
thanks for your help. I did an update query and it didn't update all of my records.. What am I doing wrong?

Pat Hartman
03-27-2002, 09:04 AM
It's hard to say without seeing the query.

tamravnu
03-27-2002, 09:07 AM
This is what I used for my query

Field "status"
Table "SGDeNews"
Update to "free trial"
Criteria "free trial"

it only returned 86 records instead of all 3,000.

"status" is the field name
"sgdenews" is the name of the table
free trial is what i want to update all records to.

Thank you so much for your help!

Rich
03-27-2002, 10:10 AM
You've set the criteria to "free trial" so it will only update those records already containing that text. Remove the criteria.

tamravnu
03-28-2002, 07:08 AM
ok I got the update query to work. now i'm trying to set it so that new records automatically have "free trial" as the default. In the properties box of the form for the field "status" I put the function
=[status].ItemData(free trial) and in the Control source i put "status".

When I try to create a new record in the form it says "error#" in the box.

any suggestions?

Thanks!

Pat Hartman
03-28-2002, 07:45 AM
The default value should be simply:

"free trial"