buttons

D

DaveB

How do I make a button that will fill the time in a field
when I push it? Do I do this in a form or a table?
 
J

Jim/chris

Create a query that updates the table with todays date
and/or time. Create a button which runs tha query.

Jim
 
C

Chris

Always use forms to view/edit your data.

In the design view of a form, drop a button on the form.
Then, right click, go to Properties. on the Events tab,
select the On Click event. This will occur whenever you
click the button.

Now, select the drop down, and select [Event Procedure].
Click the ... on the right.


You will see something like

Private Sub Command17_OnClick()

End Sub
 
C

Chris

Oops, sent too soon.


After the Private Sub line, type


Me.FieldName = Time()



Replace the FieldName with the name of the field. Let me
know if you have any other questions.



Chris
 
S

Simonc

I guess there are lots of ways, but here is one, but you need to click
on it to up date it. No table needed, just a form, command button, and
text box.

Private Sub Command0_Click()
Dim stTime As Date
stTime = Now()
stTime = Right(stTime, 8)
Text1.SetFocus
Text1.Text = stTime
End Sub
 

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