473,405 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Changing Hour/Min/AM-PM

I have a textbox for Hour, a textbox for Minute, a textbox for AM/PM and an up
button and down button to increment/decrement the values in the textboxes. I
have the code to increment/decrement all three, what I need is a way to tell the
buttons which textbox to increment/decrement. Can anyone help.

Thanks!

Mark

Nov 12 '05 #1
1 1775
Hi Mark,

Suppose you click on the Hour textbox and then on the Up button. The
button takes the focus from the textbox, but Screen.PreviousControl
still points to it. Try something like this (untested air code) in the
beginning of the buttons' Click() event procedures:

Dim ctlC As Control

Set ctlC = Screen.PreviousControl
ctlC.SetFocus
Select Case ctlC.Name
Case "txtHour", "txtMinute"
'code here to increment or decrement
With ctlC

End With
Case "txtAMPM"
'code to change from AM to PM or vice versa
With ctlC

End With
Case Else
'button was pressed when some other control
'had focus: do nothing
End Select
Set ctlC = Nothing

On Tue, 06 Jan 2004 05:07:42 GMT, "Mark" <mm*****@earthlink.net> wrote:
I have a textbox for Hour, a textbox for Minute, a textbox for AM/PM and an up
button and down button to increment/decrement the values in the textboxes. I
have the code to increment/decrement all three, what I need is a way to tell the
buttons which textbox to increment/decrement. Can anyone help.

Thanks!

Mark


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Craig Keightley | last post by:
I want to set a value of a variabel $var based on the time of day eg if time is between 10:00pm and 9:00 am set $var = "foo" if time is between 9:00 am and 7.00pm set $var = "bar" if time...
2
by: spoonerstreet | last post by:
I am trying to take standard MS Time: 2/22/2006 8:56:37 AM (stored in MS Decimal Format) and convert it to the half hour of the day it occurred in: 2/22/2006 8:56:37 AM would be in the 18th...
3
by: Iain Adams | last post by:
hey does anyone know to convert a time string in the form dd-mm-yyyyThh:mm:ss i.e 2006-08-01T15:45:11-00:00 to a normal unix time stamp or something that at least I can use to compare to a unix...
5
by: soulkitchen | last post by:
After I change a fairly complex stored procedure and I run a report against it, crystal hangs at "assesing database". I have verified the database. When I run a trace on SQL is shows repeated...
18
JamesDC
by: JamesDC | last post by:
Hi, So I'm working with an Access 2002 database for waste managemnt. The person in my role before my put together the program before he left and now I'm in charge of it. After updating a few...
7
by: billygotee | last post by:
Hi, Okay this is taking longer to figure out than I thought it would. The integer members of a DateTime (such as DateTime.Minutes, DateTime.Seconds, etc.) can only get the value, not set it. ...
1
by: mgn2683 | last post by:
I am working on a project using Dreamweaver CS3, and I am not very familiar with html or php code. Essentially I am trying to set something up so that a user is allowed to enter information into...
5
by: Steve Swift | last post by:
Is there a universally correct way to change the weight of the font in an <INPUT TYPE=TEXTcontrol or do I have to use some trick, or even browser sniffing to achieve the same result despite the...
10
ollyb303
by: ollyb303 | last post by:
Hello, Need some help with an Access 2000 query. My query is based on a table which is a log of calls to my company. I am using a date range entered by the user (Date Between And ) and...
5
by: maury | last post by:
Hello, I have an SQL Server table with a (text) field in which there is a data value in this format: 200802290525 I need to build an update query the modifies this value subtracting 1 (one)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.