View Full Version : Add customer function not working HELP


goldstar19821982
03-29-2008, 10:05 AM
hi there could ne1 help me out i am trying to get the add customer function working on my database but im getting a compile error and it is asking me to change the following coding

Function AddCustomer() As Long
'used to add a new Customer to the system, function called by frmCustomerList

'Declare and initialise the database object
Dim dbCustomer As Database
Set dbCustomer = DBEngine.Workspaces(0).Databases(0):(

Rabbie
03-29-2008, 11:39 AM
hi there could ne1 help me out i am trying to get the add customer function working on my database but im getting a compile error and it is asking me to change the following coding

Function AddCustomer() As Long
'used to add a new Customer to the system, function called by frmCustomerList

'Declare and initialise the database object
Dim dbCustomer As Database
Set dbCustomer = DBEngine.Workspaces(0).Databases(0):(

I have just tried this and it compiles without error.

You may need to make sure that the Microsoft Object library is ticked in the References in the Tools Menu

Also it may help to have

Dim dbCustomer As DAO.Database

goldstar19821982
03-30-2008, 05:00 AM
thank you for your help im still having problems i ve tried the methods you have suggested must by my access

Rabbie
03-30-2008, 05:05 AM
thank you for your help im still having problems i ve tried the methods you have suggested must by my access
What error message areyou getting?

goldstar19821982
03-30-2008, 05:34 AM
im gettin a compile error message

user defined type not defined

thank you

goldstar19821982
03-30-2008, 05:39 AM
can i send anyone the database to see where i am going wrong please helllp:(

Rabbie
03-30-2008, 10:23 AM
Post your DB on the forum. Do a compact and repair and then Zip it.

Also try

Set dbCustomer = CurrentDB