Ambiguous Name

J

Jennifer

I have two separate databases, that perform exactly the same way, except one
is pulling CR and the other is pulling CB. I combined the databases because
I want the person to press one button and it run the whole thing for her. But
once in the same database, it will not run the module part because:

The expression contains ambiguous name.
You may have two or more functions with the same name in different modules.
Rename the functions so that each one has a unique name.

Here is how the CR module looks:
Public Function DoSQL()
Dim SQL As String
SQL = "UPDATE Code " & _
"SET code.number1 = '1'"
DoCmd.RunSQL SQL
DoCmd.OpenQuery "make final CR tbl", acViewNormal, acEdit

Here is how the CB module looks:

Public Function DoSQL()
Dim SQL As String
SQL = "UPDATE Code " & _
"SET code.number1 = '1'"
DoCmd.RunSQL SQL
DoCmd.OpenQuery "make final CB tbl", acViewNormal, acEdit

I think it has something to do with the DoSQL() but I'm not too sure. Can
anyone help?
Thanks,
Jennifer
 
J

Jeff Boyce

Jennifer

As the error message suggests, Access can't figure out which "DoSQL()"
function to run because you have two. Change the names of these to better
reflect their purposes. Then change how you call them to be sure you're
getting the right one.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jennifer

Thank You Jeff, this worked!!!

Jeff Boyce said:
Jennifer

As the error message suggests, Access can't figure out which "DoSQL()"
function to run because you have two. Change the names of these to better
reflect their purposes. Then change how you call them to be sure you're
getting the right one.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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