change textbox to combobox

mu

Registered User.
Local time
Today, 11:16
Joined
May 22, 2002
Messages
18
I have a form I am using to enter data, at the same time as entering data to the current record I may occasionally have data to be added to or entered into another record, but the main use is for data entry.
I know I could open a second form to complete the task but my prefered way if possible would be to change the current forms settings

What I have been attempting to do is, on the click of a button,

1. Get the "stocknum" field to change from a textbox to a combobox thus making it easier to find the record I require, and

2. Change the value on the 'forms' Data Entry property from yes to no, allowing the form to show data that matches the value of the "stocknum"

Obviously these changes need to be temporary so when the save button is clicked the form returns to its original data entry format.

Hope Ive explained it well

Thanks
MU
 
The table which is the recordsource for your form should have a field which is a number (ID) referencing a row in the table which is the rowsource for the combobox.

When entering data, picking the row via the combobox, the id will be stored in the form recordsource. The combobox has a 2 column table as it's rowsource, id and data value. The id is hidden in the combobox list. The combobox column count property should be set to 2, and the comboboc column width property should be set to 0;1"" (hiding the id).

Because the id is stored in your data table, the correct data will always be displayed in your form. It's not necessary to switch back and forth between a textbox and combobox.

Hopefully this is clearer than mud. See the form in the attached zipped Access 97 mdb.
 

Attachments

Users who are viewing this thread

Back
Top Bottom