Cmd button and how to find what it is connected to

S

sverre

Hi

I have made som cmd buttons and connected on click some queries and some
macros to run.

But how do i find what macro or query I have added after finishing and
saving the command button.

I right clicked properties but in procedures I come to the VBA ? Code and
that does not help me. I want to see what macro or what query I have
connected to the cmd.

Many helps from an access beginner.
Sverre
 
S

Scott McDaniel

Hi

I have made som cmd buttons and connected on click some queries and some
macros to run.

But how do i find what macro or query I have added after finishing and
saving the command button.

Not sure about your macros, but if you've simply told the button to run a query, then you haven't added anything, you've
just run a stored query.
I right clicked properties but in procedures I come to the VBA ? Code and
that does not help me. I want to see what macro or what query I have
connected to the cmd.

If you're using VBA Events to run your code, then you can select the Events tab of the Properties dialog, then select
[Event Procedure] from the drop down to be taken to the VB Edit window ... this should show you what code is being fired
when the button is clicked.

If you're using macros, same thing applies - select the name of the macro, and the macro design environment should open.
Many helps from an access beginner.
Sverre

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
S

sverre

Hi Scott,

Many thanks for your answer, but I still have problems to see what the
procedure I use using (in this case below it is a query that runs-but do I
see what query??)

If i for example have a cmd-button that on click runs a query then I dont
under-
stand how to find what query I connected. If I go to the event-tab I only in
the
button down list see a list of my macros and also a row called eventprocedure.
If I choose the tab to the right of the button down list and also stand on
the event procedure row I get to the VB editor. Below I show the code. I
cannot from it see what query that is used, or can I?

Private Sub Cmd_Lägg_till_sidan_om_betalningar_Click()
On Error GoTo Err_Cmd_Lägg_till_sidan_om_betalningar_Click

Dim stDocName As String

stDocName = "Lägg till nya sidan om betalningar"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Cmd_Lägg_till_sidan_om_betalningar_:
Exit Sub

Err_Cmd_Lägg_till_sidan_om_betalningar_Click:
MsgBox Err.Description
Resume Exit_Cmd_Lägg_till_sidan_om_betalningar_

End Sub

Best regards from

Sverre

"Scott McDaniel" skrev:
Hi

I have made som cmd buttons and connected on click some queries and some
macros to run.

But how do i find what macro or query I have added after finishing and
saving the command button.

Not sure about your macros, but if you've simply told the button to run a query, then you haven't added anything, you've
just run a stored query.
I right clicked properties but in procedures I come to the VBA ? Code and
that does not help me. I want to see what macro or what query I have
connected to the cmd.

If you're using VBA Events to run your code, then you can select the Events tab of the Properties dialog, then select
[Event Procedure] from the drop down to be taken to the VB Edit window ... this should show you what code is being fired
when the button is clicked.

If you're using macros, same thing applies - select the name of the macro, and the macro design environment should open.
Many helps from an access beginner.
Sverre

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
S

sverre

Hi again.

I see now that the code belows shows what query that is beeing executed.
Question solved,
thanks
Sverre

"Scott McDaniel" skrev:
Hi

I have made som cmd buttons and connected on click some queries and some
macros to run.

But how do i find what macro or query I have added after finishing and
saving the command button.

Not sure about your macros, but if you've simply told the button to run a query, then you haven't added anything, you've
just run a stored query.
I right clicked properties but in procedures I come to the VBA ? Code and
that does not help me. I want to see what macro or what query I have
connected to the cmd.

If you're using VBA Events to run your code, then you can select the Events tab of the Properties dialog, then select
[Event Procedure] from the drop down to be taken to the VB Edit window ... this should show you what code is being fired
when the button is clicked.

If you're using macros, same thing applies - select the name of the macro, and the macro design environment should open.
Many helps from an access beginner.
Sverre

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top