Remembering and prefilling new record with last combobox selection

G

Guest

I have a field called [company] on a continuous form. There are three
drop-down options in this field (in a combobox). All records will have the
same value until the next time the form is opened. And all new records
created HAVE to have the same [company] value as the rest.

Below is my code that is on the 'OnLoad' event for the form
[AccountingDetailsForm], but this only works for text fields. What needs to
change for a combobox selection?

Me.Company.DefaultValue = """" & Me.Company.Value & """"
 
G

Guest

I tried that before and that didn't work. When I open the form the company
field shows '#Name?'.

This field doesn't have a key ID number so the selections are stored as
text, which is why I thought I would need the """. What am I missing?

Ofer said:
Try this, remove the quote

Me.Company.DefaultValue = Me.Company.Value
--
I hope that helped
Good luck


BLTibbs said:
I have a field called [company] on a continuous form. There are three
drop-down options in this field (in a combobox). All records will have the
same value until the next time the form is opened. And all new records
created HAVE to have the same [company] value as the rest.

Below is my code that is on the 'OnLoad' event for the form
[AccountingDetailsForm], but this only works for text fields. What needs to
change for a combobox selection?

Me.Company.DefaultValue = """" & Me.Company.Value & """"
 

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