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.

 All Forums
 Other Forums
 MS Access
 Learning MS Access 2000, error problem.

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 mismatch

Here is the code, the line in between the spaces is the problem:

Private Sub CboCeItemNo_AfterUpdate()

Dim string1 As Integer
Dim rs As Recordset
string1 = 5

string1 = [CboCeItemNo].Column(0)

Set rs = Me.RecordsetClone
rs.FindFirst "[CeItemNo] = " & string1
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If
rs.Close
Me.[CboCeItemNo] = ""
End Sub

This 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.
Go to Top of Page

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.
Go to Top of Page
   

- Advertisement -