Combo Box Allows User to Change data

T

ToniS

I have a combo box that allows the user to change the text once they select a
fee from the drop down list. The text itself does not change, but the table
that stores the information reflects the users change.

Ex. User selected "Booth Fees for 3 Booths" from the dropdown list, The
user then Highlighted "Booth Fees" part and deleted it. The user then
clicked on the invoice comand button to print an invoice. The invoice
printed "for 3 booths" and the table that stores the Shows Fee information
(ShowsFees) had "for 3 booths" instead of "Booth Fees for 3 Booths".

The combobox row source type is table/view/SP and the Row source is a simple
select statement from the MasterFees table. The subform RecordSource is the
Table ShowFees.

Is there a way to prevent the user from trying to change the text after they
select a fee from the list? I have tried Locked, Enabled properties and that
did not work.

Any Help is greatly appreciated

Thanks
ToniS
 
K

Klatuu

Set the combo's Limit To List property to Yes.
Then, if you don't like the default Access error message, you can do that in
the combo's Not In List event.

MsgBox "Select an Item From the List"
Response = acDataErrContinue
 
T

ToniS

Thanks for the quick response, I checked and I do have that set to Y.
When I do highlight some of the text and delete it, the ComboBox looks fine,
all of the text still displays.. just when it gets stored to the ShowsFee
table, the informtion is stored the way the user changed it...
 
K

Klatuu

try adding this line to the procedure:

Me.MyCombo Undo

That should put the value back to what is was before the user changed it,
but without being able to test it at the moment, I don't know if it will
still have the correct value or not.
 
T

ToniS

THANK YOU!!! That worked perfectly!!

Klatuu said:
try adding this line to the procedure:

Me.MyCombo Undo

That should put the value back to what is was before the user changed it,
but without being able to test it at the moment, I don't know if it will
still have the correct value or not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top