Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Boolean Range control

Status
Not open for further replies.

CGill

Programmer
Jan 2, 2003
51
GB
I would like to utilise a calender to insert dates in to a range of fields 6 in total. I need the calender to work in such a way that on the 1st click it completes field 1, second click field 2 and so on....

I've got an idea of how to do it but not the coding skills to put this down.

A finger in the right direction would be useful...
 
In the click event procedure for your calendar
Assuming the calendar is on the same form as the fields, you will need code something like this (i don't know what your calendar is so this is just generic)
I am assuming the 6 fields are called:
fieldname1
fieldname2
etc

If the fields have names which don't have this pattern then you will have to test for each value of Knt.

Static Knt
if Knt = 7 then Knt = 1

me("fieldname" & knt) = me.calendar.value
knt = knt + 1
 
Thanks for reply however me("fieldname" & knt) does not CONCATENATE correctly. I understand the principle behind your code but the method of pulling the field name and knt together will not work....any ideas ?
 
How about:

Code:
Select Case Knt

Case 1

me!fieldname1.value = me.calendar.value

Case 2

me!fieldname2.value = me.calendar.value

etc...

Iain
 
The above will also step through but does not allow for a second,third click etc....it would parse the same date [original one] to every field.
 
How about if you update a hidden control?

Code:
form_load

me!HiddenControl.Value = 1

Button_click

me!HiddenControl.Value = me!HiddenControl.Value + 1

if me!HiddenControl.Value = 7 me!HiddenControl.Value = 1

Else

End If

Select Case me!HiddenControl.Value 

Case 1

me!fieldname1.value = me.calendar.value

Case 2

me!fieldname2.value = me.calendar.value

etc...

Not sure if you'll need to use variables to hold the value for the hidden control or if you'll just be able to update directly.

Iain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top