Ambiguous Name

  • Thread starter Thread starter Jennifer
  • Start date Start date
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
 
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
 
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
 
Back
Top