Accessing the Text Box name

Penmore

Registered User.
Local time
Today, 11:36
Joined
Apr 2, 2006
Messages
27
I have a series of text boxes on a form that are named day1 to day35. When the user double clicks on an empty text box, a form is opened to allow the user to enter a new record. I want to use the text box field name to extract the day number of the text box that the user has clicked on.

Can somebody let me know what needs to be added to this line to refer to the text box name that the user has double clicked on:

Forms![Availability]![Availability_Chart subform]……
 
I've managed to find a way around this::)

When I double click on the Text Box, I open the new form from a VB module, following the DoCmd I set the field value in the new form that is open:

DoCmd.OpenForm "New_Booking"
Forms![New_Booking]![New Booking subform].Form.[Reservation Date].Value = Forms![Availability]![startdate] + 1

I will increment the value after the [startdate] to reflect the number of the Text Box the user has just double clicked on.

Thanks,
Peter
 
Heh :) the other alternative is to write a public function in the form that is opened that takes the day number as a parameter and stores it:

Code:
Dim dayno as integer

public sub setday(day as integer)
   dayno = day
end sub
which you can then call in each text box with the correct number to set it.

Other alternative is to make the variable itself public so you can set it directly from your calling form
 

Users who are viewing this thread

Back
Top Bottom