default value in combo box in form

grapevine

Registered User.
Local time
Today, 21:49
Joined
Feb 21, 2009
Messages
39
I have a form which has four tabs on it. Each tab is referencing fields in a table, but most of the fields are set as combo boxes. The combo boxes link to a lookup table (tblstatus)which give the choices of Yes,No or N/A. (was advised that this was better than lookupwizard). This appears to be working fine.

However, I would like the default value to be set to No rather than blank, as my reports (queries behind the reports) are looking for missing data where the field is set to No

I have set the default table properties of each field to No and also tried setting the default value of the combo box to No but when I add a new record all the fields remain blank.

Are there any other properties that I need to change in order to set the default value to No or would it be easier to change my queries to look for is null or No

Any assistance greatly appreciated

Marion
 
If your table is storing a 1 or a 2 (like 1 for yes and 2 for no) the you need to set the default of the combo to that

=1

or

=2
 
My tblstatus which is the lookuptable just has one field called status into which I have typed three records, Yes, No and N/A.

Does this help?
 
So the default in the COMBO BOX property DEFAULT VALUE should be

="No"

with the equals sign, and the quotes.
 
This is what I thought but I am not getting any default values in the box. I have tried checking the default value is set and then deleting and reinserting the field into the tab but I still do not get a default value.

I am using Access 2007 if case this makes a difference. Could it be the tabs? or am I better off changing my queries to search for No or is Nullf
 
This is what I thought but I am not getting any default values in the box. I have tried checking the default value is set and then deleting and reinserting the field into the tab but I still do not get a default value.

I am using Access 2007 if case this makes a difference. Could it be the tabs? or am I better off changing my queries to search for No or is Nullf
In case you weren't aware, defaults are only good for new records. Nothing will happen for existing records.
 
This may be where the problem is.

I am using a combo box which is selecting a record based on a value i select. This is from tblclient

Private Sub cboSelectClient_AfterUpdate()
DoCmd.SearchForRecord , "", acFirst, "[ClientLearnerNum] = " & Str(Nz(Screen.ActiveControl, 0))
End Sub

So presumably, as this is a value I select this now consists as not being a new record so the default values do not appear, even though every field is blank as they are derived from another table. (tblcourse) Is my assumption correct or am I just getting confused. I can work round this by changing the queries to look for is null or No but I thought this would be tidier solution when the users viewed the data.

Many thanks for your advice
 
What SuperStars!

You were correct. I have now input a record completely from scratch and my fields are now completed.

Jal also responded to my post and pointed out that I may not see the default entries straight away, but I would if I then returned to the record and this is indeed happening.

Many thanks for your help Bob and Jal, it has been much appreciated and my problem is now solved.

Marion
 

Users who are viewing this thread

Back
Top Bottom