Confused with form name

Paul Cooke

Registered User.
Local time
Today, 23:44
Joined
Oct 12, 2001
Messages
288
Hi I have a fome called 'AccidentOnly' which is quiet clearly in my navigation list it's main data source is from a table called 'Accidents'

to get to this form the user has to navigate through to it by first selecting a name which then enalbes a command button.

The on click event of this button is below

Code:
DoCmd.OpenForm "AccidentOnly", , , , acFormAdd
DoCmd.Close acForm, "FindPatientAccident"

when I click on the command button the form opens but is called 'Accidents' (the same as the table name) not 'AccidentOnly' (as it is in the navigation bar)

As soon as I click the design button on the form the name change to it's proper name 'AccidentOnly'

I have no idea what is going on - any advice gratfully recieved!

Many thanks
 
Is the Caption property of your form AccidentOnly set to Accidents by any chance.

Also you might want to consider implementing a naming protocol along the lines of FRM_FormName, TBL_TableName, QRY_QueryName etc. to make it easier to identify the type of object you are referring to in code and elsewhere.
 
oops Thanks john I feel a right plonker that was meant to be me selecting the record source instead I changed the caption !!

Re the naming protocol these are all just test forms for now but I will make the changes once it is ready to go

Many thanks again
 

Users who are viewing this thread

Back
Top Bottom