|
-
Mar 16th, 2009, 03:30 AM
#1
Thread Starter
Member
[RESOLVED] error 3265
Last edited by kirara22; Mar 16th, 2009 at 04:44 AM.
-
Mar 16th, 2009, 06:22 AM
#2
Re: error 3265
That is not a VB error. That is an SQL error. It means that the field you are referencing doesn't exist.
-
Mar 16th, 2009, 07:08 AM
#3
Thread Starter
Member
Re: error 3265
i c.. hehhehe..
can u help me out how would i generate automatic id number for customer?
tnx
-
Mar 16th, 2009, 09:12 AM
#4
Hyperactive Member
Re: error 3265
Hello,
If the database uses an autonumber field for the table primary key then you do not need to create the key field value yourself, the database will do it automatically.
Kind regards
Steve
-
Mar 16th, 2009, 09:17 AM
#5
Thread Starter
Member
Re: error 3265
but how would it apper during loadform in my IDNUMBER.caption.
tnx
-
Mar 16th, 2009, 11:24 AM
#6
Hyperactive Member
Re: error 3265
Hello,
From post #2 Hack identified that you were using an incorrect field name for the primary key field. If that is the case you will need to correctly identify the name of the primary key field and then use its value for the label caption.
You will need to use the recordset object:
Code:
With rs
.ActiveConnection = cn
.Source = SQL
.Open
End With
newID_Number.caption = rs(0).Value
When you need to create a new record the rs.AddNew will automatically cause a new identity key field value to be created.
rs.Update will then write the new values to the database.
I will add that the user doesn't need the key field value and doesn't even need to know it exists.
P.S. This code is written off the top of my head so may contain errors.
Kind regards
Steve
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|