I would like to have a default value, entered automatically in a feild which uses a lookup list. I hope I am being clear. The feild uses a Combo box to look up values from a lookup table. How can I have the feild automatically begin with a selected value?
Here is the problem; this database is to be distributed to others users who will have unique defaults (their name and contact info). I would like the lookup list to default to the first item in the list.
I did a little searching and came up with this.....
Specify which row is the default value in a list box or combo box
In a form, you can specify which row is automatically selected in a list box or combo box. This procedure does not apply to data access pages.
1. Open a form in Design view.
2. Make sure that the combo box is selected and then click Properties on the Form Design toolbar.
3. In the DefaultValue property box, type [comboboxname].ItemData(n) where n is the row that you want to use as the default. The ItemData property is zero-based, so type ItemData(0) if you want to make the first row in the list the default. For example, to specify the first row of the SupplierCombo combo box as the default for the combo box, type [SupplierCombo].ItemData(0) in the DefaultValue property box. Note: If you want to specify a default value for a lookup combo box in Microsoft Access database (.mdb) table Design view, enter a default value in the DefaultValue property for the foreign key. For example, if you have a SupplierID foreign key(foreign key: One or more table fields (columns) that refer to the primary key field or fields in another table. A foreign key indicates how the tables are related.) in a Products table, click the SupplierID field, and then enter a valid supplier ID number in the DefaultValue property box in the lower portion of the window. The next time you add this Supplier ID field to a form, Access automatically sets the default value for the field.
Great Thanks so much! I am trying to give a star but it is erroring out. I tried to make that work for a long time, your solution works great!
On a different matter, on which I have posted several times; I need to design a large report but the report design view is not long enough to fit the feilds I need to add. I have maxed out the length of the design view. What do I do? How can I design a large report? Any help you can give would be great!
One last problem with the default combo selection; I have the combo box set to fill in several fields (address etc) when the selection is made. Using the default method, the other fields are not updating. Is there any way to make the default selection update to fill in the other feilds?
On your report space matter. You really are only limited on space by the size paper you print to. Editing the page setup will give you more space (extending margins and page size). Once you have done that then just extend your workspace in design view. I inserted a pic, but when I view it, it's really huge....sorry
I tried it and it worked for me. Type (fill in appropriate names) this into the other field's, that you want to automatically update, defult value property on the Data tab and you should be good to go.
Well...here's the problem; I have stretched the design view for the report as far as it goes to the bottom of the page. It does not go any further. (changing paper size in page setup is a separate issue I believe). When I pull the detail section to lengthen the design view it hit rock bottom and can go no further. Is this the limit of the report page design?
Good Idea! I will test that to see how the formatting comes out. I do have a footer, I will need to play with this a bit. I wonder how on earth you can create a long report?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.