Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Baffled by a combo box problem 2

Status
Not open for further replies.

LD1010

Technical User
Dec 6, 2001
78
US
I’m baffled by a comb box problem. I have form on which I created 6 combo boxes (using the combo box wizard) to find records on the form. All 6 of the combo boxes worked as expected when I click on them using the computer I used to create the form. The Access vs. on this computer is 2002. It also worked fine on another computer also running 2002. But when I pull up this form on any other computer running Access vs. 2003 four of the combo boxes work fine and the other two do not. I’ve recreated the combo boxes on a computer running vs. 2003 but get the same results. Any help on this would be much appreciated.

The name of the form is frmVehicles, the record source is qryVehiclesEntry

One of the combo boxes that works is called, cboFindByVehicleID, the row source is, SELECT [qryVehiclesEntry].[VehicleID] FROM [qryVehiclesEntry]
The code on the after update event is:
Private Sub cboFindByVehicleID_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[VehicleID] = " & Str(Nz(Me![cboFindByVehicleID], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

One of the combo boxes that does not work is called, cboFindByLicenseNumber, the row source is, SELECT [qryVehiclesEntry].[LicenseNumber] FROM [qryVehiclesEntry]
The code on the after update event is:
Private Sub cboFindByLicenseNumber_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[LicenseNumber] = '" & Me![cboFindByLicenseNumber] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
 
What do you mean by, "do not work"? What are the combo boxes triggering and what specifically is not happening that should be happening on these boxes?

 
The combo boxes that don’t work (when using a computer running vs. 2003) do not display any of the of the field data. There is no displayed value to select from. Yet when using a computer running vs. 2002 the field data is displayed and when you select an item the record is returned.
 
I just recently had a problem like this and found out that the problem was in the design of the table you are pulling this field from to put in your combo box.

Go to the table where VehicleID is kept and look in the properties for that field. In the "Format" property, check for a ">" symbol. If it is there, remove it. Save the table and close it and re-open your form. Dimes to donuts says that your combo box will show the data now.

 
Thanks Hawimatidasa! That was the problem. I appreciate the help. Do you know if there is another way to force the display of upper case without using the > symbol in the Format property?
 
Yes - for example, I have a text box where the data is always four numbers followed by either an "N" or and "E". I always want the "N" or "E" capitalized, so I have the "Format" property in the table design set to "0000L". Now, anyone who enters data into that field is forced to put in four numbers and a letter. In each case where I have this field displayed on a form or report, I set the format for the field to "0000L" and the letter is always capitalized.

Hope this helps!
 
This is a bug introduced in Access 2003 SP3.

Could you explicitly convert values to upper case before saving them to the table using the UCase() function?

Ed Metcalfe.

Please do not feed the trolls.....
 
I just think it was awesome help so here is the star for you Hawi! WOW!
 
Thanks again Hawi! The willingness of all you seasoned contributors are a marvelous asset to us beginners. Thanks Ed2020, I’ll give that a try.
 
Ed2020, how/where would you use the Ucase() function?

Wow! My first 2 stars! Just a few thousand more and I will be up there with Ed202! LOL!

 
How and where UCase() is used would depend on how the data is getting into the table. If from an unbound form the string could be altered before being saved to a recordset:

Code:
Recordset.AddNew
   Recordset!FieldName = UCase("string goes here")
Recordset.Update

If the data is inserted into the table from a query the field could be updated from an expression converting the value to upper case

Code:
INSERT INTO Table1 ( Field1 ) SELECT UCase("Some string") AS ExpressionName;

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top