473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

New to MS Access 2000, error problem.

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.
Sep 21 '06 #1
3 1738
MMcCarthy
14,534 Expert Mod 8TB
Check the datatype of CelItemNo if its text and not integer then do the following:

Dim string1 As String

string1 = "5"
rs.FindFirst "[CeItemNo] = '" & string1 & "'"

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.
Sep 21 '06 #2
PEB
1,418 Expert 1GB
Hi,

And if not a string do:

rs.FindFirst "[CeItemNo] = " & str(string1)

:)
Sep 22 '06 #3
Check the datatype of CelItemNo if its text and not integer then do the following:

Dim string1 As String

string1 = "5"
rs.FindFirst "[CeItemNo] = '" & string1 & "'"

This worked partially, I no longer get the error. But now when I select a CE# out of the combo box it will display the info for that # in the the other fields of the form, but will not let me select more records for other CE #s. The drop down box still works and displays all the CE #s to choose from, but nothing happens when I try and select one.
Sep 22 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Mike Thomas | last post by:
I have two clients now who want to have an Access 2000 & 2002 application running on NT Server 2000 do some file updating at night when nobody is in the office. I have used Windows scheduler to...
2
by: Peter Mather | last post by:
Hi, I have struck problems when trying to convert an Access97 database to Access 2000. I get a compile Error when I start the database in Access 2000.. The message is Can't find project or...
6
by: Ecohouse | last post by:
I have a computer with XP on it. I loaded Office 97 first because I needed Access 97 for some work. I then loaded Office 2000. Everything seemed to be running fine. But I have come across a few...
3
by: Stan | last post by:
Hallo, I have developed an application in MS Access 2000 (Polish version) under MS Windows XP prof (also Polish). Now I would like to run this code on MS Windows XP EN and MS Access XP EN. I have...
0
by: M. Farrenkopf | last post by:
I am in the process of converting a Jet database to ADP using SQL Server 2000. Most of this conversation has been smooth, but now I'm running across a problem that has me stumped. Access 2000 SP3...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
9
by: MM | last post by:
And Access 2000 et seq 32 bit? MM
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
2
by: Christine.Misseri | last post by:
Hi all, I'm sure someone knows about this problem. I have an Access database designed in Access 2000, connected to an ORACLE 8i back end. On the ORACLE side I have stored procedures, triggers...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.