Import Problems

D

d9pierce

Hi all,
As most of you know I made a database "wow"! Now I have it done I
wanted to share it so I was testing a copy and it failed.

Now, I made a blank DB and imported everything from my origional. The
origional works fine but when I use the new one, I get errors when I
try to add a not in list. The debug comes up and it is identical to my
origional but it all stops there. Here is the code that is cresting a
problem. Now, I have several of these and none of them work? Please
help me out here!

Private Sub ContactType_NotInList(NewData As String, Response As
Integer)
Dim strsql As String, x As Integer
x = MsgBox("Contact Type Not in Current List, Would you Like to Add?",
vbYesNo)
If x = vbYes Then
strsql = "Insert Into Tbl_Contact_Type ([ContactType]) values ('" &
NewData & "')"
'MsgBox strsql
CurrentDb.Execute strsql, dbFailOnError
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub

I just dont understand why it would work in my origional and not in a
copy?

Thanks in advance.
Dave
 
A

Allen Browne

What error message do you get?

If this is Access 2000 or 2002, you may need to add a reference to:
Microsoft DAO 3.6 Library
To do that open a code window, and choose References on the Tools menu.

More info on references:
http://allenbrowne.com/ser-38.html
 
D

d9pierce

Hi Allen,
Its a real funny thing I guess? I am using 2002 and i do have reference
to DAO 3.6. This works fine but cannot create a new db and import and
have this work on the same machine even!

In any event, I copied and pasted it, then changed the name and it
works fine! Really strange but it worked!

Thanks a lot!

Dave



Allen said:
What error message do you get?

If this is Access 2000 or 2002, you may need to add a reference to:
Microsoft DAO 3.6 Library
To do that open a code window, and choose References on the Tools menu.

More info on references:
http://allenbrowne.com/ser-38.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hi all,
As most of you know I made a database "wow"! Now I have it done I
wanted to share it so I was testing a copy and it failed.

Now, I made a blank DB and imported everything from my origional. The
origional works fine but when I use the new one, I get errors when I
try to add a not in list. The debug comes up and it is identical to my
origional but it all stops there. Here is the code that is cresting a
problem. Now, I have several of these and none of them work? Please
help me out here!

Private Sub ContactType_NotInList(NewData As String, Response As
Integer)
Dim strsql As String, x As Integer
x = MsgBox("Contact Type Not in Current List, Would you Like to Add?",
vbYesNo)
If x = vbYes Then
strsql = "Insert Into Tbl_Contact_Type ([ContactType]) values ('" &
NewData & "')"
'MsgBox strsql
CurrentDb.Execute strsql, dbFailOnError
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub

I just dont understand why it would work in my origional and not in a
copy?

Thanks in advance.
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top