If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Prevent combo box from updating a table
My application includes a Combo Box which gets it's values from a query, when
I close the form it inserts the value which is in the combo box into the table from which that data came from. How do I prevent the insert? |
#2
|
|||
|
|||
Prevent combo box from updating a table
On Thu, 11 Mar 2010 20:33:28 GMT, "avtuvy" u58699@uwe wrote:
My application includes a Combo Box which gets it's values from a query, when I close the form it inserts the value which is in the combo box into the table from which that data came from. How do I prevent the insert? If the purpose of the combo box is just to find a record, and you don't want it to update anything when you make a selection, simply set its Control Source property to blank. This makes it an "unbound" combo box, to use the proper jargon. -- John W. Vinson [MVP] |
#3
|
|||
|
|||
Prevent combo box from updating a table
Your combo has the same Control Source name as the field it is being stored
in. Rename it to cboMyField instead of MyField, with nothing in the Control Source "avtuvy" u58699@uwe wrote in message news:a4dd4503b4845@uwe... My application includes a Combo Box which gets it's values from a query, when I close the form it inserts the value which is in the combo box into the table from which that data came from. How do I prevent the insert? |
#4
|
|||
|
|||
Prevent combo box from updating a table
Thanks, works like a charm.
I am using a parameter from the same combo box as an input for a query but getting an error. The query which loads the combo box loads it with two columns and the ID which is used for the query is the second column, I guess I have a syntax error, please help UPDATE dbo_DEVICES SET dbo_DEVICES.ID = Forms.frmDevices.Combo40.Column.[2]; John W. Vinson wrote: My application includes a Combo Box which gets it's values from a query, when I close the form it inserts the value which is in the combo box into the table from which that data came from. How do I prevent the insert? If the purpose of the combo box is just to find a record, and you don't want it to update anything when you make a selection, simply set its Control Source property to blank. This makes it an "unbound" combo box, to use the proper jargon. |
#5
|
|||
|
|||
Prevent combo box from updating a table
On Thu, 11 Mar 2010 21:38:02 GMT, "avtuvy" u58699@uwe wrote:
Thanks, works like a charm. I am using a parameter from the same combo box as an input for a query but getting an error. The query which loads the combo box loads it with two columns and the ID which is used for the query is the second column, I guess I have a syntax error, please help UPDATE dbo_DEVICES SET dbo_DEVICES.ID = Forms.frmDevices.Combo40.Column.[2]; Do you really want to do this? As written this query will update *every single record* in the table dbo_Devices, setting the ID field to whatever is in the third column of the combo box. If it's really what I'd call an ID this will fail, since a primary key ID must be unique within the table. Please describe in words what you're trying to accomplish. Where is the data in the combo coming from, and what are you trying to do to dbo_DEVICES? -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|