Is it possible to "enable" a combo box?

jjh

Registered User.
Local time
Today, 11:33
Joined
Jun 7, 2006
Messages
32
Hi:
Some help is appreciated:

What I want to do: On activation of a command button on 'Form A', I would like an existing combo box on Form A to be enabled (e.g. allow a user to select values in combo box), and once the user has selected the value in the combo box, copy that value to field in a table B. Is this possible? How can it be done?

The values being displayed in the combo box are a result of a query on an existing table. Knowing this, is there a better way to do the above?

Thanks for your help..
John
 
Yes it is possible to use a command button to enable a combo box or a toggle button to enable/disable.

I would like an existing combo box on Form A to be enabled (e.g. allow a user to select values in combo box), and once the user has selected the value in the combo box, copy that value to field in a table B.

Why not put the combo box on formB? From your description it is doing nothing on formA.
 
ansentry said:
Yes it is possible to use a command button to enable a combo box or a toggle button to enable/disable.

Why not put the combo box on formB? From your description it is doing nothing on formA.

OK, care to enlighten me on HOW this is done?
I don't want to put the combo box on form B because the table that is being modified by the combo box is being displayed in form A. For my application, even though the table where the combo box gets its data is seperate from the table that is in form A, the two tables are logically related.
Thank you for your post.
John
 
In design mode, change the enabled value of the combobox to No
In the on_click event of your cmdButton put Me.comboboxname.enabled = true.

Use the afterupdate of the combobox to transfer the value
 
Hi!

Private Sub btnSomething_Click()
Dim strSql As String

Me!cboComboBox.Enabled = True
End Sub

Private Sub cboComboBox_AfterUpdate()
strSql = "INSERT INTO tblB(myID,myItem,myPrice) " _
& "SELECT myID,myItem,myPrice " _
& "FROM tblA " _
& "WHERE myID = " & Me!cmoComboBox

CurrentDB.Execute strSql, dbFailOnError
End Sub

Remenber that myID probably is the first field in the select query that fills the combobox.

Hope this helps :-)
jjh said:
Hi:
Some help is appreciated:

What I want to do: On activation of a command button on 'Form A', I would like an existing combo box on Form A to be enabled (e.g. allow a user to select values in combo box), and once the user has selected the value in the combo box, copy that value to field in a table B. Is this possible? How can it be done?

The values being displayed in the combo box are a result of a query on an existing table. Knowing this, is there a better way to do the above?

Thanks for your help..
John
 

Users who are viewing this thread

Back
Top Bottom