A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Main Menu Form Will Not Open



 
 
Thread Tools Display Modes
  #21  
Old August 17th, 2009, 07:04 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Main Menu Form Will Not Open

Post the code for this function
Public Function CMD_EnableCommandBarCtl(pcbr As CommandBar, pstrTag As
String, fEnable As Boolean) As Boolean



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"Brent" wrote in message
...

Jeannette

Here is the first place the code stoped at I pressed F8

Public Function CMD_EnableCommandBarCtl(pcbr As CommandBar, pstrTag As
String, fEnable As Boolean) As Boolean

Compile error user-defined type not defined

I can not proceed pass this line.

Thanks



"Jeanette Cunningham" wrote:

Here are the steps to debug this code:
Find the line Call RecordTrace("basApplFunctions",
"APPL_StartApplication")
and click in the very far left margin for this line to set a break
point -
when it is set you will see the whole line coloured red.
Save and close the code window.
Close the startup form if it is open.
Now open the startup form.
The code will stop at the break point you set.
Now press F8 to step through the code.


Post back with results.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Hi Jeanette

Here is the code where the yellow highlight starts, I just found it. Do
you
see anything in the code that is causing the problem? It looks to me
like
there might be something here as it tells to stop application if !!!!
The
form is in the startup

Public Function APPL_StartApplication() As Boolean

Dim fldEntityName As Field
Dim fldEntityPath As Field
Dim intI As Integer
Dim lngNumDatabases As Long
Dim qdfEntity As QueryDef
Dim rstEntity As Recordset
Dim strMsg As String

On Error GoTo Err_APPL_StartApplication
Call RecordTrace("basApplFunctions", "APPL_StartApplication")
APPL_StartApplication = False

TryRelink:
Set rstEntity = Nothing
If CMD_GetVersion() "8.0" Then
strMsg = gconSystemTitle & " must be run with Microsoft Access
97
or
later"
MsgBox strMsg, vbOKOnly + vbCritical, gconSystemTitle
Application.Quit A_EXIT
End If

Set gwrk = DBEngine.Workspaces(0)
Set gdb = CurrentDb

Set qdfEntity = gdb.QueryDefs("qselEntityDatabases")
Set rstEntity = qdfEntity.OpenRecordset
With rstEntity
.MoveLast
.MoveFirst
lngNumDatabases = .RecordCount
Set fldEntityName = .Fields("EntityName")
Set fldEntityPath = .Fields("EntityPath")
End With
ReDim gdbLinked(1 To lngNumDatabases)
intI = 0
With rstEntity
.MoveFirst
Do While Not .EOF
intI = intI + 1
Set gdbLinked(intI) = DBEngine.OpenDatabase(fldEntityPath &
"\"
& fldEntityName)
.MoveNext
Loop
.Close
End With

'Set startup properties of database
If CMD_IsItMDE(CurrentDb) Then
Call CMD_SetStartupProperties
End If

APPL_StartApplication = True

Exit_APPL_StartApplication:
Exit Function

Err_APPL_StartApplication:
Select Case Err.Number
Case 3044, 3051, 3043
MBX_Ok "Unable to open the database " & fldEntityPath & "\"
&
fldEntityName
If Not CMD_OpenForm("frmEntitymaintenance",
plngWindowMode:=acDialog) Then Resume Exit_APPL_StartApplication
Resume TryRelink
Case 10001 'Error in called procedure
Case Else
Call GlobalError("basApplFunctions" &
".APPL_StartApplication")
End Select
Resume Exit_APPL_StartApplication

End Function

Thanks again for all your help





"Jeanette Cunningham" wrote:

There are 3 references you need for A2003
Visual basic for applications
Microsoft Access 11.0 Object Library
Microsoft DAO 3.6 Object Library

When you imported all the objects, you may have ommitted the menus.
Go back to the import screen and under options select Menus and
Toolbars.
Don't select any tables, queries etc, just the menus and toolbars.
See if this fixes the problem.

What is the name of the form that should open when the database opens?
Have you put this form as the startup form in the database options |
Tools |
Startup
Display Form/Page:


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Hi Jeanette

Sorry for not getting back sooner but work got in the way.

Now that I have converted the database what should the new
references
be?
it
looks like I still have the same old ones.

I now get this new error message

Microsoft can not find the macro "mnuMain" the macro groups don't
exist
or
it is new and has not been saved, then it talks about the macorgroup
that
was
saved
I must specify the same macroname in the argument???

Any ideas on this?




"Jeanette Cunningham" wrote:

Option Explicit
Option Compare Database

should be in the order

Option Compare Database
Option Explicit


-------------------------
macros - that's fine. You have checked for macros and there are no
macros.
That is one less thing to check for errors.

----------------------

About converting to A2003
One easy way that I do conversions is to create a new blank
database
in
the
newer version and be sure to set 'Track Name Auto correct' to No.
So create a new blank database in A2003, go to Tools | Options |
General
tab
and set Track name autocorrect to no.

Do you have linked tables?
If you do, use the new blank database you just created and import
the
tables
into it (don't link them).

Then create another new blank database for the front end.
Link the tables to the new database, then import all the other
objects -
queries, forms etc.

If you don't have linked tables, just create one new database as
described
above.
Import everything from the 97 database to the new one.

After you finish the import do a compile.
Check for the correct references.

You will now have an A2003 version of your database and can
continue
on
with
fixing any errors.




Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
news Hi Jeanette

This is where the compiler stops when I run debug on the Modules
of
the
database that I have converted to 2003. It just stops on this
line
and
does
not give an error message.

your previous message:
I don't have Access 2000 on my computer anymore

The next thing to check is the code.
What code do you have when the database opens? It tell me
Microsoft
access
can not find the macro "mnuMain" I lkkoed and there are no
macros
in
this
database not ever Auotexec macro
Is there an autoexec macro?
What code is on the main menu form? Do you want me to post all of
the
code
I
found for the form? it is long.
How do I put break points on the subs and functions?

Gina asked that on the top of every module had
Option Explicit
Option Compare Database

Yes they do however they are in reverse order, does this matter?

Thanks again for all your help. This post maybe confusing, let me
know





"Jeanette Cunningham" wrote:

Is this function the spot where the compiler stops and gives an
error?
What error does it give?


Jeanette Cunningham MS Access MVP -- Melbourne Victoria
Australia



"Brent" wrote in message
...
Here is me first debug problem that is identified

Public Function CMD_EnableCommandBarCtl(pcbr As CommandBar,
pstrTag
As
String, fEnable As Boolean) As Boolean

This shows up in each Module I debug. Does this help or is
their
more
to
this that I need to post?

"Gina Whipp" wrote:

Brent,

Things I would check...

1. Please list the References you have set and the order in
which
they
appear. Because Access 97 had some References that were
unnecessary
to
future versions, once you post what you have one or two may
need
to
be
eliminated to 'fix' the Main Menu.

2. Make sure at the top of every module appears...

Option Explicit
Option Compare Database



  #22  
Old August 17th, 2009, 02:21 PM posted to microsoft.public.access.forms
Brent
external usenet poster
 
Posts: 143
Default Main Menu Form Will Not Open

Here it is

Dim ctl As CommandBarControl

On Error GoTo Err_CMD_EnableCommandBarCtl
Call RecordTrace("basCmdFunctions", "CMD_EnableCommandBarCtl", pcbr.Name)
CMD_EnableCommandBarCtl = False

Set ctl = pcbr.FindControl(msoControlButton, Tag:=pstrTag,
Visible:=True, Recursive:=True)
ctl.Enabled = fEnable

CMD_EnableCommandBarCtl = True

Exit_CMD_EnableCommandBarCtl:
Exit Function

Err_CMD_EnableCommandBarCtl:
Select Case Err
Case 91 'Control doesn't exist
CMD_EnableCommandBarCtl = True
Case Else
Call GlobalError("basCmdFunctions" & ".CMD_EnableCommandBarCtl")
End Select
Resume Exit_CMD_EnableCommandBarCtl

End Function

"Jeanette Cunningham" wrote:

Post the code for this function
Public Function CMD_EnableCommandBarCtl(pcbr As CommandBar, pstrTag As
String, fEnable As Boolean) As Boolean



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"Brent" wrote in message
...

Jeannette

Here is the first place the code stoped at I pressed F8

Public Function CMD_EnableCommandBarCtl(pcbr As CommandBar, pstrTag As
String, fEnable As Boolean) As Boolean

Compile error user-defined type not defined

I can not proceed pass this line.

Thanks



"Jeanette Cunningham" wrote:

Here are the steps to debug this code:
Find the line Call RecordTrace("basApplFunctions",
"APPL_StartApplication")
and click in the very far left margin for this line to set a break
point -
when it is set you will see the whole line coloured red.
Save and close the code window.
Close the startup form if it is open.
Now open the startup form.
The code will stop at the break point you set.
Now press F8 to step through the code.


Post back with results.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Hi Jeanette

Here is the code where the yellow highlight starts, I just found it. Do
you
see anything in the code that is causing the problem? It looks to me
like
there might be something here as it tells to stop application if !!!!
The
form is in the startup

Public Function APPL_StartApplication() As Boolean

Dim fldEntityName As Field
Dim fldEntityPath As Field
Dim intI As Integer
Dim lngNumDatabases As Long
Dim qdfEntity As QueryDef
Dim rstEntity As Recordset
Dim strMsg As String

On Error GoTo Err_APPL_StartApplication
Call RecordTrace("basApplFunctions", "APPL_StartApplication")
APPL_StartApplication = False

TryRelink:
Set rstEntity = Nothing
If CMD_GetVersion() "8.0" Then
strMsg = gconSystemTitle & " must be run with Microsoft Access
97
or
later"
MsgBox strMsg, vbOKOnly + vbCritical, gconSystemTitle
Application.Quit A_EXIT
End If

Set gwrk = DBEngine.Workspaces(0)
Set gdb = CurrentDb

Set qdfEntity = gdb.QueryDefs("qselEntityDatabases")
Set rstEntity = qdfEntity.OpenRecordset
With rstEntity
.MoveLast
.MoveFirst
lngNumDatabases = .RecordCount
Set fldEntityName = .Fields("EntityName")
Set fldEntityPath = .Fields("EntityPath")
End With
ReDim gdbLinked(1 To lngNumDatabases)
intI = 0
With rstEntity
.MoveFirst
Do While Not .EOF
intI = intI + 1
Set gdbLinked(intI) = DBEngine.OpenDatabase(fldEntityPath &
"\"
& fldEntityName)
.MoveNext
Loop
.Close
End With

'Set startup properties of database
If CMD_IsItMDE(CurrentDb) Then
Call CMD_SetStartupProperties
End If

APPL_StartApplication = True

Exit_APPL_StartApplication:
Exit Function

Err_APPL_StartApplication:
Select Case Err.Number
Case 3044, 3051, 3043
MBX_Ok "Unable to open the database " & fldEntityPath & "\"
&
fldEntityName
If Not CMD_OpenForm("frmEntitymaintenance",
plngWindowMode:=acDialog) Then Resume Exit_APPL_StartApplication
Resume TryRelink
Case 10001 'Error in called procedure
Case Else
Call GlobalError("basApplFunctions" &
".APPL_StartApplication")
End Select
Resume Exit_APPL_StartApplication

End Function

Thanks again for all your help





"Jeanette Cunningham" wrote:

There are 3 references you need for A2003
Visual basic for applications
Microsoft Access 11.0 Object Library
Microsoft DAO 3.6 Object Library

When you imported all the objects, you may have ommitted the menus.
Go back to the import screen and under options select Menus and
Toolbars.
Don't select any tables, queries etc, just the menus and toolbars.
See if this fixes the problem.

What is the name of the form that should open when the database opens?
Have you put this form as the startup form in the database options |
Tools |
Startup
Display Form/Page:


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Hi Jeanette

Sorry for not getting back sooner but work got in the way.

Now that I have converted the database what should the new
references
be?
it
looks like I still have the same old ones.

I now get this new error message

Microsoft can not find the macro "mnuMain" the macro groups don't
exist
or
it is new and has not been saved, then it talks about the macorgroup
that
was
saved
I must specify the same macroname in the argument???

Any ideas on this?




"Jeanette Cunningham" wrote:

Option Explicit
Option Compare Database

should be in the order

Option Compare Database
Option Explicit


-------------------------
macros - that's fine. You have checked for macros and there are no
macros.
That is one less thing to check for errors.

----------------------

About converting to A2003
One easy way that I do conversions is to create a new blank
database
in
the
newer version and be sure to set 'Track Name Auto correct' to No.
So create a new blank database in A2003, go to Tools | Options |
General
tab
and set Track name autocorrect to no.

Do you have linked tables?
If you do, use the new blank database you just created and import
the
tables
into it (don't link them).

Then create another new blank database for the front end.
Link the tables to the new database, then import all the other
objects -
queries, forms etc.

If you don't have linked tables, just create one new database as
described
above.
Import everything from the 97 database to the new one.

After you finish the import do a compile.
Check for the correct references.

You will now have an A2003 version of your database and can
continue
on
with
fixing any errors.




Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
news Hi Jeanette

This is where the compiler stops when I run debug on the Modules
of
the
database that I have converted to 2003. It just stops on this
line
and
does
not give an error message.

your previous message:
I don't have Access 2000 on my computer anymore

The next thing to check is the code.
What code do you have when the database opens? It tell me
Microsoft
access
can not find the macro "mnuMain" I lkkoed and there are no
macros
in
this
database not ever Auotexec macro
Is there an autoexec macro?
What code is on the main menu form? Do you want me to post all of
the
code
I
found for the form? it is long.
How do I put break points on the subs and functions?

Gina asked that on the top of every module had
Option Explicit
Option Compare Database

Yes they do however they are in reverse order, does this matter?

Thanks again for all your help. This post maybe confusing, let me
know





  #23  
Old August 18th, 2009, 06:18 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Main Menu Form Will Not Open

Here is some information from a colleague. He has a download that explains
it.

CommandBarControl is a member of the Office object library. If the code uses
early binding, you will need a checked reference set to the "Microsoft
Office {version} Object Library" (mso.dll). There is a downloadable sample
available on the Seattle Access User's Group site:

A2003 uses version 11.


http://www.seattleaccess.org/downloads.htm

Quick Demo for Enabling Command UI, Zac Woodall, April 2005

Download (27 kb)

Adapted for '97 and 2000/2002, Tom Wickerath, May 2005

Download (51 kb)



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Here it is

Dim ctl As CommandBarControl

On Error GoTo Err_CMD_EnableCommandBarCtl
Call RecordTrace("basCmdFunctions", "CMD_EnableCommandBarCtl",
pcbr.Name)
CMD_EnableCommandBarCtl = False

Set ctl = pcbr.FindControl(msoControlButton, Tag:=pstrTag,
Visible:=True, Recursive:=True)
ctl.Enabled = fEnable

CMD_EnableCommandBarCtl = True

Exit_CMD_EnableCommandBarCtl:
Exit Function

Err_CMD_EnableCommandBarCtl:
Select Case Err
Case 91 'Control doesn't exist
CMD_EnableCommandBarCtl = True
Case Else
Call GlobalError("basCmdFunctions" &
".CMD_EnableCommandBarCtl")
End Select
Resume Exit_CMD_EnableCommandBarCtl

End Function

"Jeanette Cunningham" wrote:

Post the code for this function
Public Function CMD_EnableCommandBarCtl(pcbr As CommandBar, pstrTag As
String, fEnable As Boolean) As Boolean



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"Brent" wrote in message
...

Jeannette

Here is the first place the code stoped at I pressed F8

Public Function CMD_EnableCommandBarCtl(pcbr As CommandBar, pstrTag As
String, fEnable As Boolean) As Boolean

Compile error user-defined type not defined

I can not proceed pass this line.

Thanks



"Jeanette Cunningham" wrote:

Here are the steps to debug this code:
Find the line Call RecordTrace("basApplFunctions",
"APPL_StartApplication")
and click in the very far left margin for this line to set a break
point -
when it is set you will see the whole line coloured red.
Save and close the code window.
Close the startup form if it is open.
Now open the startup form.
The code will stop at the break point you set.
Now press F8 to step through the code.


Post back with results.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Hi Jeanette

Here is the code where the yellow highlight starts, I just found it.
Do
you
see anything in the code that is causing the problem? It looks to me
like
there might be something here as it tells to stop application if
!!!!
The
form is in the startup

Public Function APPL_StartApplication() As Boolean

Dim fldEntityName As Field
Dim fldEntityPath As Field
Dim intI As Integer
Dim lngNumDatabases As Long
Dim qdfEntity As QueryDef
Dim rstEntity As Recordset
Dim strMsg As String

On Error GoTo Err_APPL_StartApplication
Call RecordTrace("basApplFunctions", "APPL_StartApplication")
APPL_StartApplication = False

TryRelink:
Set rstEntity = Nothing
If CMD_GetVersion() "8.0" Then
strMsg = gconSystemTitle & " must be run with Microsoft
Access
97
or
later"
MsgBox strMsg, vbOKOnly + vbCritical, gconSystemTitle
Application.Quit A_EXIT
End If

Set gwrk = DBEngine.Workspaces(0)
Set gdb = CurrentDb

Set qdfEntity = gdb.QueryDefs("qselEntityDatabases")
Set rstEntity = qdfEntity.OpenRecordset
With rstEntity
.MoveLast
.MoveFirst
lngNumDatabases = .RecordCount
Set fldEntityName = .Fields("EntityName")
Set fldEntityPath = .Fields("EntityPath")
End With
ReDim gdbLinked(1 To lngNumDatabases)
intI = 0
With rstEntity
.MoveFirst
Do While Not .EOF
intI = intI + 1
Set gdbLinked(intI) = DBEngine.OpenDatabase(fldEntityPath
&
"\"
& fldEntityName)
.MoveNext
Loop
.Close
End With

'Set startup properties of database
If CMD_IsItMDE(CurrentDb) Then
Call CMD_SetStartupProperties
End If

APPL_StartApplication = True

Exit_APPL_StartApplication:
Exit Function

Err_APPL_StartApplication:
Select Case Err.Number
Case 3044, 3051, 3043
MBX_Ok "Unable to open the database " & fldEntityPath &
"\"
&
fldEntityName
If Not CMD_OpenForm("frmEntitymaintenance",
plngWindowMode:=acDialog) Then Resume Exit_APPL_StartApplication
Resume TryRelink
Case 10001 'Error in called procedure
Case Else
Call GlobalError("basApplFunctions" &
".APPL_StartApplication")
End Select
Resume Exit_APPL_StartApplication

End Function

Thanks again for all your help





"Jeanette Cunningham" wrote:

There are 3 references you need for A2003
Visual basic for applications
Microsoft Access 11.0 Object Library
Microsoft DAO 3.6 Object Library

When you imported all the objects, you may have ommitted the menus.
Go back to the import screen and under options select Menus and
Toolbars.
Don't select any tables, queries etc, just the menus and toolbars.
See if this fixes the problem.

What is the name of the form that should open when the database
opens?
Have you put this form as the startup form in the database options
|
Tools |
Startup
Display Form/Page:


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Hi Jeanette

Sorry for not getting back sooner but work got in the way.

Now that I have converted the database what should the new
references
be?
it
looks like I still have the same old ones.

I now get this new error message

Microsoft can not find the macro "mnuMain" the macro groups don't
exist
or
it is new and has not been saved, then it talks about the
macorgroup
that
was
saved
I must specify the same macroname in the argument???

Any ideas on this?




"Jeanette Cunningham" wrote:

Option Explicit
Option Compare Database

should be in the order

Option Compare Database
Option Explicit


-------------------------
macros - that's fine. You have checked for macros and there are
no
macros.
That is one less thing to check for errors.

----------------------

About converting to A2003
One easy way that I do conversions is to create a new blank
database
in
the
newer version and be sure to set 'Track Name Auto correct' to
No.
So create a new blank database in A2003, go to Tools | Options |
General
tab
and set Track name autocorrect to no.

Do you have linked tables?
If you do, use the new blank database you just created and
import
the
tables
into it (don't link them).

Then create another new blank database for the front end.
Link the tables to the new database, then import all the other
objects -
queries, forms etc.

If you don't have linked tables, just create one new database as
described
above.
Import everything from the 97 database to the new one.

After you finish the import do a compile.
Check for the correct references.

You will now have an A2003 version of your database and can
continue
on
with
fixing any errors.




Jeanette Cunningham MS Access MVP -- Melbourne Victoria
Australia

"Brent" wrote in message
news Hi Jeanette

This is where the compiler stops when I run debug on the
Modules
of
the
database that I have converted to 2003. It just stops on this
line
and
does
not give an error message.

your previous message:
I don't have Access 2000 on my computer anymore

The next thing to check is the code.
What code do you have when the database opens? It tell me
Microsoft
access
can not find the macro "mnuMain" I lkkoed and there are no
macros
in
this
database not ever Auotexec macro
Is there an autoexec macro?
What code is on the main menu form? Do you want me to post all
of
the
code
I
found for the form? it is long.
How do I put break points on the subs and functions?

Gina asked that on the top of every module had
Option Explicit
Option Compare Database

Yes they do however they are in reverse order, does this
matter?

Thanks again for all your help. This post maybe confusing, let
me
know







  #24  
Old August 19th, 2009, 03:49 AM posted to microsoft.public.access.forms
Brent
external usenet poster
 
Posts: 143
Default Main Menu Form Will Not Open

Jeanette

I got the downloads and opened them however, I'm not sure how they work, do
I copy some of the code into my code?

I can understand it you have had enough of this and want to move on.

thanks again for your help

"Jeanette Cunningham" wrote:

Here is some information from a colleague. He has a download that explains
it.

CommandBarControl is a member of the Office object library. If the code uses
early binding, you will need a checked reference set to the "Microsoft
Office {version} Object Library" (mso.dll). There is a downloadable sample
available on the Seattle Access User's Group site:

A2003 uses version 11.


http://www.seattleaccess.org/downloads.htm

Quick Demo for Enabling Command UI, Zac Woodall, April 2005

Download (27 kb)

Adapted for '97 and 2000/2002, Tom Wickerath, May 2005

Download (51 kb)



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Here it is

Dim ctl As CommandBarControl

On Error GoTo Err_CMD_EnableCommandBarCtl
Call RecordTrace("basCmdFunctions", "CMD_EnableCommandBarCtl",
pcbr.Name)
CMD_EnableCommandBarCtl = False

Set ctl = pcbr.FindControl(msoControlButton, Tag:=pstrTag,
Visible:=True, Recursive:=True)
ctl.Enabled = fEnable

CMD_EnableCommandBarCtl = True

Exit_CMD_EnableCommandBarCtl:
Exit Function

Err_CMD_EnableCommandBarCtl:
Select Case Err
Case 91 'Control doesn't exist
CMD_EnableCommandBarCtl = True
Case Else
Call GlobalError("basCmdFunctions" &
".CMD_EnableCommandBarCtl")
End Select
Resume Exit_CMD_EnableCommandBarCtl

End Function

"Jeanette Cunningham" wrote:

Post the code for this function
Public Function CMD_EnableCommandBarCtl(pcbr As CommandBar, pstrTag As
String, fEnable As Boolean) As Boolean



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"Brent" wrote in message
...

Jeannette

Here is the first place the code stoped at I pressed F8

Public Function CMD_EnableCommandBarCtl(pcbr As CommandBar, pstrTag As
String, fEnable As Boolean) As Boolean

Compile error user-defined type not defined

I can not proceed pass this line.

Thanks



"Jeanette Cunningham" wrote:

Here are the steps to debug this code:
Find the line Call RecordTrace("basApplFunctions",
"APPL_StartApplication")
and click in the very far left margin for this line to set a break
point -
when it is set you will see the whole line coloured red.
Save and close the code window.
Close the startup form if it is open.
Now open the startup form.
The code will stop at the break point you set.
Now press F8 to step through the code.


Post back with results.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Hi Jeanette

Here is the code where the yellow highlight starts, I just found it.
Do
you
see anything in the code that is causing the problem? It looks to me
like
there might be something here as it tells to stop application if
!!!!
The
form is in the startup

Public Function APPL_StartApplication() As Boolean

Dim fldEntityName As Field
Dim fldEntityPath As Field
Dim intI As Integer
Dim lngNumDatabases As Long
Dim qdfEntity As QueryDef
Dim rstEntity As Recordset
Dim strMsg As String

On Error GoTo Err_APPL_StartApplication
Call RecordTrace("basApplFunctions", "APPL_StartApplication")
APPL_StartApplication = False

TryRelink:
Set rstEntity = Nothing
If CMD_GetVersion() "8.0" Then
strMsg = gconSystemTitle & " must be run with Microsoft
Access
97
or
later"
MsgBox strMsg, vbOKOnly + vbCritical, gconSystemTitle
Application.Quit A_EXIT
End If

Set gwrk = DBEngine.Workspaces(0)
Set gdb = CurrentDb

Set qdfEntity = gdb.QueryDefs("qselEntityDatabases")
Set rstEntity = qdfEntity.OpenRecordset
With rstEntity
.MoveLast
.MoveFirst
lngNumDatabases = .RecordCount
Set fldEntityName = .Fields("EntityName")
Set fldEntityPath = .Fields("EntityPath")
End With
ReDim gdbLinked(1 To lngNumDatabases)
intI = 0
With rstEntity
.MoveFirst
Do While Not .EOF
intI = intI + 1
Set gdbLinked(intI) = DBEngine.OpenDatabase(fldEntityPath
&
"\"
& fldEntityName)
.MoveNext
Loop
.Close
End With

'Set startup properties of database
If CMD_IsItMDE(CurrentDb) Then
Call CMD_SetStartupProperties
End If

APPL_StartApplication = True

Exit_APPL_StartApplication:
Exit Function

Err_APPL_StartApplication:
Select Case Err.Number
Case 3044, 3051, 3043
MBX_Ok "Unable to open the database " & fldEntityPath &
"\"
&
fldEntityName
If Not CMD_OpenForm("frmEntitymaintenance",
plngWindowMode:=acDialog) Then Resume Exit_APPL_StartApplication
Resume TryRelink
Case 10001 'Error in called procedure
Case Else
Call GlobalError("basApplFunctions" &
".APPL_StartApplication")
End Select
Resume Exit_APPL_StartApplication

End Function

Thanks again for all your help





"Jeanette Cunningham" wrote:

There are 3 references you need for A2003
Visual basic for applications
Microsoft Access 11.0 Object Library
Microsoft DAO 3.6 Object Library

When you imported all the objects, you may have ommitted the menus.
Go back to the import screen and under options select Menus and
Toolbars.
Don't select any tables, queries etc, just the menus and toolbars.
See if this fixes the problem.

What is the name of the form that should open when the database
opens?
Have you put this form as the startup form in the database options
|
Tools |
Startup
Display Form/Page:


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"Brent" wrote in message
...
Hi Jeanette

Sorry for not getting back sooner but work got in the way.

Now that I have converted the database what should the new
references
be?
it
looks like I still have the same old ones.

I now get this new error message

Microsoft can not find the macro "mnuMain" the macro groups don't
exist
or
it is new and has not been saved, then it talks about the
macorgroup
that
was
saved
I must specify the same macroname in the argument???

Any ideas on this?




"Jeanette Cunningham" wrote:

Option Explicit
Option Compare Database

should be in the order

Option Compare Database
Option Explicit


-------------------------
macros - that's fine. You have checked for macros and there are
no
macros.
That is one less thing to check for errors.

----------------------

About converting to A2003
One easy way that I do conversions is to create a new blank
database
in
the
newer version and be sure to set 'Track Name Auto correct' to
No.
So create a new blank database in A2003, go to Tools | Options |
General
tab
and set Track name autocorrect to no.

Do you have linked tables?
If you do, use the new blank database you just created and
import
the
tables
into it (don't link them).

  #25  
Old August 19th, 2009, 05:17 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Main Menu Form Will Not Open

Brent, I didn't look at the downloads. I understood that they were examples.

Do this--
Open your database and open the code window.
You are using A2003 aren't you.
Go to Tools | References
and scroll down the list till you find
Microsoft Office 11 Object Library
Check the box next to this reference then close the references dialog.
Do a compile.
Hopefully it will compile and the main menu problem will be fixed.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia




"Brent" wrote in message
...
Jeanette

I got the downloads and opened them however, I'm not sure how they work,
do
I copy some of the code into my code?

I can understand it you have had enough of this and want to move on.

thanks again for your help

"Jeanette Cunningham" wrote:

Here is some information from a colleague. He has a download that
explains
it.

CommandBarControl is a member of the Office object library. If the code
uses
early binding, you will need a checked reference set to the "Microsoft
Office {version} Object Library" (mso.dll). There is a downloadable
sample
available on the Seattle Access User's Group site:

A2003 uses version 11.


http://www.seattleaccess.org/downloads.htm

Quick Demo for Enabling Command UI, Zac Woodall, April 2005

Download (27 kb)

Adapted for '97 and 2000/2002, Tom Wickerath, May 2005

Download (51 kb)



  #26  
Old August 23rd, 2009, 11:41 PM posted to microsoft.public.access.forms
Brent
external usenet poster
 
Posts: 143
Default Main Menu Form Will Not Open

Thanks again Jeanette for all of your help. I am going to go back to the
begining of these posts and redo everything you and others have suggested to
make sure I have not missed anything. If that doen't work I think I will be
at the end with this form and maybe try to recreate it.

Once again thanks for everything.

"Jeanette Cunningham" wrote:

Brent, I didn't look at the downloads. I understood that they were examples.

Do this--
Open your database and open the code window.
You are using A2003 aren't you.
Go to Tools | References
and scroll down the list till you find
Microsoft Office 11 Object Library
Check the box next to this reference then close the references dialog.
Do a compile.
Hopefully it will compile and the main menu problem will be fixed.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia




"Brent" wrote in message
...
Jeanette

I got the downloads and opened them however, I'm not sure how they work,
do
I copy some of the code into my code?

I can understand it you have had enough of this and want to move on.

thanks again for your help

"Jeanette Cunningham" wrote:

Here is some information from a colleague. He has a download that
explains
it.

CommandBarControl is a member of the Office object library. If the code
uses
early binding, you will need a checked reference set to the "Microsoft
Office {version} Object Library" (mso.dll). There is a downloadable
sample
available on the Seattle Access User's Group site:

A2003 uses version 11.


http://www.seattleaccess.org/downloads.htm

Quick Demo for Enabling Command UI, Zac Woodall, April 2005

Download (27 kb)

Adapted for '97 and 2000/2002, Tom Wickerath, May 2005

Download (51 kb)




  #27  
Old August 24th, 2009, 02:17 AM posted to microsoft.public.access.forms
Tom Wickerath
external usenet poster
 
Posts: 3,914
Default Main Menu Form Will Not Open

Hi Brent,

Did you verify that you have a checked reference set to the "Microsoft
Office 11.0 Object Library"? Also, were you able to get the sample available
for download from the Seattle Access User's group to run okay on your PC?

Have you verified that your code compiles without any errors?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

"Brent" wrote:

Thanks again Jeanette for all of your help. I am going to go back to the
begining of these posts and redo everything you and others have suggested to
make sure I have not missed anything. If that doen't work I think I will be
at the end with this form and maybe try to recreate it.

Once again thanks for everything.

"Jeanette Cunningham" wrote:

Brent, I didn't look at the downloads. I understood that they were examples.

Do this--
Open your database and open the code window.
You are using A2003 aren't you.
Go to Tools | References
and scroll down the list till you find
Microsoft Office 11 Object Library
Check the box next to this reference then close the references dialog.
Do a compile.
Hopefully it will compile and the main menu problem will be fixed.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

  #28  
Old August 24th, 2009, 04:03 AM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Main Menu Form Will Not Open

As I understand, all your forms have this code in them. I would have thought
that all your forms would have the same problem when you try to open them.

If this was me, I would comment out the code on this main form that doesn't
work and then open the form to see if it will open.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


"Brent" wrote in message
...
Thanks again Jeanette for all of your help. I am going to go back to the
begining of these posts and redo everything you and others have suggested
to
make sure I have not missed anything. If that doen't work I think I will
be
at the end with this form and maybe try to recreate it.

Once again thanks for everything.

"Jeanette Cunningham" wrote:

Brent, I didn't look at the downloads. I understood that they were
examples.

Do this--
Open your database and open the code window.
You are using A2003 aren't you.
Go to Tools | References
and scroll down the list till you find
Microsoft Office 11 Object Library
Check the box next to this reference then close the references dialog.
Do a compile.
Hopefully it will compile and the main menu problem will be fixed.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia




"Brent" wrote in message
...
Jeanette

I got the downloads and opened them however, I'm not sure how they
work,
do
I copy some of the code into my code?

I can understand it you have had enough of this and want to move on.

thanks again for your help

"Jeanette Cunningham" wrote:

Here is some information from a colleague. He has a download that
explains
it.

CommandBarControl is a member of the Office object library. If the
code
uses
early binding, you will need a checked reference set to the "Microsoft
Office {version} Object Library" (mso.dll). There is a downloadable
sample
available on the Seattle Access User's Group site:

A2003 uses version 11.


http://www.seattleaccess.org/downloads.htm

Quick Demo for Enabling Command UI, Zac Woodall, April 2005

Download (27 kb)

Adapted for '97 and 2000/2002, Tom Wickerath, May 2005

Download (51 kb)







  #29  
Old August 27th, 2009, 02:59 AM posted to microsoft.public.access.forms
Brent
external usenet poster
 
Posts: 143
Default Main Menu Form Will Not Open

Jeanette

How do I comment out the code on the main form? I'm not sure if all the
forms have the same code I could check and post back.

I will post back to Tom under his post, I'm not sure if that is how it's
done or if I should post back under the last post.

Thanks again I can't believe you are still with this.

"Jeanette Cunningham" wrote:

As I understand, all your forms have this code in them. I would have thought
that all your forms would have the same problem when you try to open them.

If this was me, I would comment out the code on this main form that doesn't
work and then open the form to see if it will open.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


"Brent" wrote in message
...
Thanks again Jeanette for all of your help. I am going to go back to the
begining of these posts and redo everything you and others have suggested
to
make sure I have not missed anything. If that doen't work I think I will
be
at the end with this form and maybe try to recreate it.

Once again thanks for everything.

"Jeanette Cunningham" wrote:

Brent, I didn't look at the downloads. I understood that they were
examples.

Do this--
Open your database and open the code window.
You are using A2003 aren't you.
Go to Tools | References
and scroll down the list till you find
Microsoft Office 11 Object Library
Check the box next to this reference then close the references dialog.
Do a compile.
Hopefully it will compile and the main menu problem will be fixed.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia




"Brent" wrote in message
...
Jeanette

I got the downloads and opened them however, I'm not sure how they
work,
do
I copy some of the code into my code?

I can understand it you have had enough of this and want to move on.

thanks again for your help

"Jeanette Cunningham" wrote:

Here is some information from a colleague. He has a download that
explains
it.

CommandBarControl is a member of the Office object library. If the
code
uses
early binding, you will need a checked reference set to the "Microsoft
Office {version} Object Library" (mso.dll). There is a downloadable
sample
available on the Seattle Access User's Group site:

A2003 uses version 11.


http://www.seattleaccess.org/downloads.htm

Quick Demo for Enabling Command UI, Zac Woodall, April 2005

Download (27 kb)

Adapted for '97 and 2000/2002, Tom Wickerath, May 2005

Download (51 kb)








  #30  
Old August 27th, 2009, 03:05 AM posted to microsoft.public.access.forms
Brent
external usenet poster
 
Posts: 143
Default Main Menu Form Will Not Open

Hi Tom

Thanks for your input. At first it seemed that the office 11.0 reference was
not showing up but now I do have it. I did download the sample and I could
get it to open but I was not sure what to do with it.

Have you verified that your code compiles without any errors? I have tried
many things with the code, could you explain how this works?

Once again Thanks

"Tom Wickerath" wrote:

Hi Brent,

Did you verify that you have a checked reference set to the "Microsoft
Office 11.0 Object Library"? Also, were you able to get the sample available
for download from the Seattle Access User's group to run okay on your PC?

Have you verified that your code compiles without any errors?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

"Brent" wrote:

Thanks again Jeanette for all of your help. I am going to go back to the
begining of these posts and redo everything you and others have suggested to
make sure I have not missed anything. If that doen't work I think I will be
at the end with this form and maybe try to recreate it.

Once again thanks for everything.

"Jeanette Cunningham" wrote:

Brent, I didn't look at the downloads. I understood that they were examples.

Do this--
Open your database and open the code window.
You are using A2003 aren't you.
Go to Tools | References
and scroll down the list till you find
Microsoft Office 11 Object Library
Check the box next to this reference then close the references dialog.
Do a compile.
Hopefully it will compile and the main menu problem will be fixed.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:25 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.