Please Support

hany1002

New member
Local time
Today, 12:11
Joined
Aug 7, 2011
Messages
5
when i convert my access batabase from access 2003 to access 2007

from mdb to accdb

i receved error in this code part

-------------
code
-------------

Private Sub ACCID_BeforeUpdate(Cancel As Integer)
Set Q1 = CurrentDb.OpenRecordset("select * from Accounts where AccId = '" & AccID & "'")
If Q1.RecordCount > 0 Then
 

Attachments

  • error.jpg
    error.jpg
    92.2 KB · Views: 126
A couple of things.

- if AccId is Numeric, you don't need the single quotes.
- Where is Q1 dimmed?

- when you Dim variables in this manner

Dim mylen,myclen, mylevel, i as Integer you are Not doing what you think,
This will Dim i as Integer, but mylen, myclen and mylevel will be Variants

To make multiple integers you need to do as follows

Dim mylen as integer, myclen as Integer, mylevel as Integer.
 
can you help me in this database
I'm not good at VB

The database in attach files

the error in Form_Addaccounts VB Code

Thanks
 

Attachments

Users who are viewing this thread

Back
Top Bottom