Access Newbie (1 Viewer)

MatthewJapp

Registered User.
Local time
Today, 15:37
Joined
Nov 22, 2010
Messages
28
Hello, I am an access newbie.

I'm designing a database to manage a property problem my the organisation I work for currently suffers.

I have broken down the data into tables, and have built forms with tabs for the database layout. In each of the tabs there is a subform driven by a depot filter I have at the top of the front screen. The forms are filled with a linked query for each tab pulling through the data from tables using left joins.

What I am trying to do (unsucessfully) is simply open a form I've built with a query on the press of a button.

I know this must be frustrating easy for some of you but please share the knowledge :eek:)

M
 

GODZILLA

Registered User.
Local time
Today, 07:37
Joined
Mar 15, 2010
Messages
70
Hello,

Create a button and add

DoCmd.OpenForm "Name of form"

To the on click command.
 

MatthewJapp

Registered User.
Local time
Today, 15:37
Joined
Nov 22, 2010
Messages
28
I am using 2007 and get the error message Access can't find the object 'DoCmd'
 

GODZILLA

Registered User.
Local time
Today, 07:37
Joined
Mar 15, 2010
Messages
70
DoCmd.OpenForm qryServiceSchedule


DoCmd.OpenForm "qryServiceSchedule"

Also make sure you have vba allowed in your database.

Access options>Trust centre setting>Macro settings>Enable
 

MatthewJapp

Registered User.
Local time
Today, 15:37
Joined
Nov 22, 2010
Messages
28
I already enabled Macros, still get the same message? It's driving me mad :eek:)
 

DCrake

Remembered
Local time
Today, 15:37
Joined
Jun 8, 2005
Messages
8,626
Are you trying to open a form aor a query?

DoCmd.OpenForm qryServiceSchedule

if qryServiceSchedule is the name of the form I suggest you rename it to FrmServiceSchedule. Having forms and queries with the same name can lead to all sorts of problems.
 

MatthewJapp

Registered User.
Local time
Today, 15:37
Joined
Nov 22, 2010
Messages
28
Thanks DCrake...I understand that naming a form with qry can lead to all kinds of problems, in this mock up I've called the form after the query just so I know what I've linked (newbie I know.. :eek:) the form is actually called qry the error message is that access can't fidn the object DoCmd? driving me insane...
 

DCrake

Remembered
Local time
Today, 15:37
Joined
Jun 8, 2005
Messages
8,626
Cut and paste the code you are using so we can check for errors
 

MatthewJapp

Registered User.
Local time
Today, 15:37
Joined
Nov 22, 2010
Messages
28
I have the form set up which is based on a query using 2 table info with a left join

I have a button one one of my forms which 'is supposed' to open the form so I go into the design view of the command button, right click, go to properties, then in the 'Event' tab type

DoCmd.OpenForm "qryServiceSchedule"

and get that error message...

please forgive me if this is something simple, I only started using access a couple of weeks back and hope to be an advanced user very soon :eek:)
 

GODZILLA

Registered User.
Local time
Today, 07:37
Joined
Mar 15, 2010
Messages
70
I have the form set up which is based on a query using 2 table info with a left join

I have a button one one of my forms which 'is supposed' to open the form so I go into the design view of the command button, right click, go to properties, then in the 'Event' tab type

DoCmd.OpenForm "qryServiceSchedule"

and get that error message...

please forgive me if this is something simple, I only started using access a couple of weeks back and hope to be an advanced user very soon :eek:)


RIGHT! the code needs to be in a procedure.

On the onclick press the drop down and select event procedure.

Then press the ...

Paste the code in between the sub() end sub()
 

MatthewJapp

Registered User.
Local time
Today, 15:37
Joined
Nov 22, 2010
Messages
28
Thank you, if only I ported my excel knowledge with me, however Access with good excel knowledge is becoming simpler by the minute - many thanks for your help :eek:)
 

Users who are viewing this thread

Top Bottom