PDA

View Full Version : What does compile error: Ambiguous name detected mean?



wedd
12-14-2011, 06:11 AM
Hi experts!


What does compile error: Ambiguous name detected mean? And how can this issue be resolved?
The code causing this error statement is listed below:


Private Sub Location_DblClick(Cancel As Integer)
End Sub


Thanks for your contributions:friends:

wedd
12-14-2011, 10:22 AM
2nd part of my query

On one of my forms an error message based on a query displays the following message: The record source 'SELECT Distinct [Venue] AS Expr2, qrySearchCriteriaSub.[Location], qrySearchCriteriaSub.[Title], qrySearchCriteriaSub.[AreaC....' specified on this form or report does not exist. When I run the compile on my code the field name venue is highlighted in yellow...the field name seems to not be recoginised...I replaced a pre-existing name in the database and replaced it with the name venue...is there other factors I have to consider when changing names in tables, queries and vba code that may result in issues?

I also receive this error:

Private Sub Form_Load()
StartDate.SetFocus
Venue = -1 (error highlighted in yellow)
frmSearchCriteriaSub.Requery
Venue = Null
StartDate.SetFocus
End Sub

(Compile error: variable not defined) WHEN I COMPILE AND RUN THE CODE...THERE IS AN ISSUE WITH THE FIELD NAME VENUE...

Can a table, queries and vba code names be changed to a pre-existing database? If so, how can it be done? And what issues would I have to consider? It's the first time I'm using a database to change various features to adapt how I would like to use it. Would you have any solutions how to deal with this issue, or have any examples how do deal with the issues as well as rectify and prevent issues occuring?
I'm not sure whether this is in accordance to database practise, but there are functionality from a database I would like to add to the functionality of my database.

Thanks for your contributions:friends:

Norie
12-15-2011, 03:49 AM
First part, that means you have 2 subs called Location_DblClick.

Second part, try looking at the records source query in QBE view.

You can do that by clicking the ellipsis (...) to the right of the Record Source property field.

If you get asked to save the query say yes.

Once in QBE view you need to check the tables/fields etc of the query and also that when you run it there it returns the expected result.

If you've renamed fields you could see things like [Venue] As Expr2.

For any renamed tables/queries will be no list of fields.

In general you can reuse forms etc but you do need to go through them to check for things like this.

If you don't you'll keep on getting these type of errors.

Sometimes it's simpler to just start over.

wedd
12-15-2011, 04:16 AM
Thanks Norie!