macro help-please

G

Guest

I have a macro set up to update information from a server. How can I show on
the switchboard when the macro was last run?
 
G

Guest

Create an unbound text box on the switchboard form and add an action in the
macro to SET VALUE of the object.
 
G

Guest

How are you running the macro? If its a button actually on the switchboard
you can add an unbound textbox formatted to short date on the switch board in
design mode. In the macro buttons on click event just add the line
Me.Yourtextboxname = date

This will add the date to the text box, here's one I prepared earlier.

The Macro I am running is Refresh, my unbound textbox is Event_Date

Private Sub Main_Menu_Click()
On Error GoTo Err_Main_Menu_Click

Dim stDocName As String

stDocName = "Refresh"
DoCmd.RunMacro stDocName
Me.Event_Date = Date


Exit_Main_Menu_Click:
Exit Sub

Err_Main_Menu_Click:
MsgBox Err.Description
Resume Exit_Main_Menu_Click

End Sub

I hope this helps? Let me know. (This only applies if you are pressing the
button on the Switchboard, a little more coding is required if you have the
button on a different form)
 
G

Guest

I have the unbound text box created but am unsure how to "SETVALUE" using the
expression builder in the macro to show the date
 
G

Guest

The button is on a secondary switchboard, I only want it to show the date
when that switchboard is open. Does that complicate things more?
 
G

Guest

In the Action Column window of the macro builder type or select:

SetVale

There are two options pop up at the bottom of the screen,
Item
Expression

Use the build event to select the switchboard and the unbound Textbox you
have made.

In the Expression window (lower window) type =Date()

As demonstrated below

Action Column = SetValue

Item Window

[Forms]![Switchboard]![Event_Date]

Expression Window

=Date()


I hope this helps, let me know


--
An Engineers Prayer:
At the very end of the day, when all else fails, you''ve tried all and asked
everyone you know,
read the instruction manual.
 
G

Guest

See my comment above on previous thread for help with the macro builder
event, add the suggested line to the end of the macro button you already
have, you may end up with a different switchboard name but if you use the
build event in the expression window, you should be able to locate the
switchboard.


--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you've tried all
and asked everyone you know,
read the instruction manual.
 
G

Guest

I have it working to a point now, the only problem is that it is returning a
date of Saturday December 3th, 1899

MikeJohnB said:
In the Action Column window of the macro builder type or select:

SetVale

There are two options pop up at the bottom of the screen,
Item
Expression

Use the build event to select the switchboard and the unbound Textbox you
have made.

In the Expression window (lower window) type =Date()

As demonstrated below

Action Column = SetValue

Item Window

[Forms]![Switchboard]![Event_Date]

Expression Window

=Date()


I hope this helps, let me know


--
An Engineers Prayer:
At the very end of the day, when all else fails, you''ve tried all and asked
everyone you know,
read the instruction manual.



John V said:
I have the unbound text box created but am unsure how to "SETVALUE" using the
expression builder in the macro to show the date
 
G

Guest

mmmmmmm, Don't know on this one, have you formatted the textbox as short or
long date in the format field of the properties of the textbox (Right click
the textbox is design mode and select properties?

I have set up a similar system here with a macro button to try out the
response to you before I posted and all is well. I have got it working using
either a macro or VBA code, both options you have been given and the date
comes out as todays date.

If you still have problems, I suggest you re-post as a seperate question.

What is your system date set to?

--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you''ve tried all
and asked everyone you know,
read the instruction manual.


John V said:
I have it working to a point now, the only problem is that it is returning a
date of Saturday December 3th, 1899

MikeJohnB said:
In the Action Column window of the macro builder type or select:

SetVale

There are two options pop up at the bottom of the screen,
Item
Expression

Use the build event to select the switchboard and the unbound Textbox you
have made.

In the Expression window (lower window) type =Date()

As demonstrated below

Action Column = SetValue

Item Window

[Forms]![Switchboard]![Event_Date]

Expression Window

=Date()


I hope this helps, let me know


--
An Engineers Prayer:
At the very end of the day, when all else fails, you''ve tried all and asked
everyone you know,
read the instruction manual.



John V said:
I have the unbound text box created but am unsure how to "SETVALUE" using the
expression builder in the macro to show the date

:

Create an unbound text box on the switchboard form and add an action in the
macro to SET VALUE of the object.

:

I have a macro set up to update information from a server. How can I show on
the switchboard when the macro was last run?
 

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