Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
RamataKahn
Starting Member
2 Posts |
Posted - 2006-09-21 : 14:37:55
|
Hello all. I recently got a new job that I am learning MS Access at, I was trying to add a new combo box to a form, but when I test it I get the following error:run-time error '13': type mismatchHere is the code, the line in between the spaces is the problem:Private Sub CboCeItemNo_AfterUpdate()Dim string1 As IntegerDim rs As Recordsetstring1 = 5string1 = [CboCeItemNo].Column(0)Set rs = Me.RecordsetCloners.FindFirst "[CeItemNo] = " & string1If Not rs.NoMatch ThenMe.Bookmark = rs.BookmarkEnd Ifrs.CloseMe.[CboCeItemNo] = ""End SubThis combo box is just supposed to pull one field of data from one table, I basicaly copied the code from another form with a combo box that does the same thing so I am unsure why it's not working. |
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2006-09-21 : 16:45:43
|
Like the error says, you have a type mismatch. The type of the variable string1 is Integer, and the value in the combobox isn't an integer. You probably need to declare string1 as a String. |
 |
|
RamataKahn
Starting Member
2 Posts |
Posted - 2006-09-22 : 16:29:21
|
Ok, I got the error to go away, but now I can only make one selection from the combo box, after that if I try another, nothing happens. |
 |
|
|
|
|