Unbound Form and combo box Problem (1 Viewer)

LNewton

Registered User.
Local time
Today, 12:23
I have an unbound entry form not populated by any query or table, that users enter date, function, number, time and user initials. The function is a combo box with a list of 97 different functions to choose from. The time function can have a user entered time value or I have created code that checks to see if the table with the various functions listed also has a time value listed. If the table has a time value, then the time field is locked and focus sent to the initial field. Because of many variables that need to be checked I have used VBA to code the fields and update a production table. The problem I have is the combo box seems to need to be tied to an underlying table to work. I can put a combo box on the form and get the correct list to appear. The combo box will not allow me to select a record. If I leave the form with a control source as a table I get double entries in the production table. Is there anyway to put a combo box on a form that does not have a control source and select a record from that combo box? Sorry for the long explanation.
 

WayneRyan

AWF VIP
Local time
Today, 12:23
LNewton,

Try:

Me.cboYourCombo.RowSource = "Select field1 " & _
"From tblYourTable Order by field1"
Me.cboYourCombo.Requery

hth,
Wayne
 

LNewton

Registered User.
Local time
Today, 12:23
I placed your code suggestion in the load event of the form that contains the combo box. i.e
Me.cboFunctionCode.RowSource = "Select Code, Function " & _
"From tblfunctions Order by Code"
Me.cboFunctionCode.Requery

It does populate the combo box but will not let you select a record within the combo box.

Must be a way but I'm brain dead at this point.
 

WayneRyan

AWF VIP
Local time
Today, 12:23
LNewton,

Haven't seen this before.

In design view check the properties of your combobox. It
must have enabled=No, or Locked=Yes, or something like
that.

Let me know.
Wayne
 

LNewton

Registered User.
Local time
Today, 12:23
The enabled property is set to Yes and the Locked property is set to No. Strange to me too. I am working on a work around but someone would think it was programed by Walt Disney it's pretty Micky Mouse!!!! Might work though
 

WayneRyan

AWF VIP
Local time
Today, 12:23
LNewton,

Before you do any drastic work-arounds try create a new
combo-box beside it and see how that works.

I'd ask you to email it to me but it would take forever to get
through our email security.

Keep me posted,
Wayne
 

LNewton

Registered User.
Local time
Today, 12:23
I already have done just that. They both acted the same way. I also have another cbo box on the same form and it also acts the same way. I do thank you for the imput. I will keep working on the problem. If I find the solution I will post it. Happy New Year
 

LNewton

Registered User.
Local time
Today, 12:23
One more question. I am using Access 97. Are you on that or higher version?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:23
I use combos on unbound forms frequently and don't experience the problem. Are you letting the wizard build the combo? If not, make sure that you have the correct values in the following properties:
ColumnCount = ?
ColumnWidths = ?
ControlSource = should be empty
RowSourceType = Table/Query
RowSource = query name, table name, or SQL statement
BoundColumn = usually 1
LimitToList = usually Yes
AutoExpand = Yes
Enabled = Yes
Locked = No

If your column count and column widths don't reflect all the columns in the query, strange problems will occur.
 

WayneRyan

AWF VIP
Local time
Today, 12:23
LNewton,

Check the items that Pat suggested. He's a great resource.

btw, I'm using Access 2000.

Can you enter data into your other controls? This is sounding
like it centers around the form?

hth,
Wayne
 

LNewton

Registered User.
Local time
Today, 12:23
Finally!!!! I had the Allow Edits property set to No. Always need to go back to the basics. I was trying to not allow any changes to the data entered once entered. This works ok if the form is bound to a table but not if it is unbound. Thanks again for all of the help. This a great web site when you are a department of one!!!!
 

Users who are viewing this thread

Top Bottom