Setting default value of field = table value

dewsbury

Registered User.
Local time
Today, 19:07
Joined
Jul 4, 2008
Messages
57
Hi,

I have a table called tbl_Period with ONE record and ONE field called [Period].


I also have a form that has a combo box called "Choose Period".


QUESTION:
How do I set the default value on the form combo box = [tbl_period].[Period]

Basically, I am looking to put a default value into this combo box that the user can control and update. The default value will change every month.

Thanks!
 
A combo box for one list item seems odd. Try an expression as the default value, such as DLookup ("[Period]", "[tbl_period]")
That would be no good if the table ever has more than one record.
EDIT: after reviewing, maybe you are saying you want to control the field value through the combo? That would make even less sense, so I'll stop speculating and wait for clarification.
 
Hi. If I read that correctly, in the Open event of your form, you could try something like:
Code:
Me.ComboboxName.DefaultValue="""" & DLookup("FieldName","TableName") & """"
Hope it helps...
 
Thank Micron and theDBGuy (especially).

Despite my less than clear question you have resolved my issue.
 
Thank Micron and theDBGuy (especially).

Despite my less than clear question you have resolved my issue.
Hi. Glad to hear you managed. Micron and I were happy to assist. Good luck with your project.
 
A "settings" table would be a pretty standard way of managing things such as the default or active period. At the end of each month/period you just increment the setting.
 

Users who are viewing this thread

Back
Top Bottom