P
pretzel
Hi,
Have tried all I have read on this site as well as on-line help etc, but I'm
sure that this can be done.
I'm building a db for a Swim Club. I'm recording Times/Dates/etc for each
Swimmer for around 39 diffent events. I'm recording the Minutes and Seconds
in two separate fields in a table and displaying them using =[sc50mB/Fly-m] &
":" & [sc50mB/Fly-s] as the Control in a TextBox. All OK so far.
To edit the time, I'm using a "EditTime" button for each event (39 buttons)
which brings up a form (EditSwimTime). I can use a different form for each
event (39 forms) but would rather use one.
This requires that pressing the button initiates variables for which the
value is passed to the EditSwimTime form.
My test button sets the variables using:
strCourse = "Short Course"
strLS = "sc"
strDist = "50m"
strStroke = "B/Fly"
I have created a new module and inserted code such as:
Global strCourse As String, strLS As String, strDist As String, strStroke As
String
Function GetCourse() As String
GetCourse = strCourse
End Function
I then use =GetCourse() in the Control of a TextBox on EditSwimTime & it all
works fine.
The problem is getting the time information from the table (there are two
tables that hold the times, ShortCourse and LongCourse)
I have created a function:
Function GetMinTime() As String
GetMinTime = strLS + strDist + strStroke + "-m"
End Function
I then use GetMinTime() as a Control in a TextBox on the EditSwimTime form,
but all it returns is sc50mB/Fly-m (the field that holds the Minitue value)
rather than returning the value in the field.
I have tried several differring structures, none of which work. I presume it
is incorrect syntax (maybee).
Any ideas?
Thanks in advance
Have tried all I have read on this site as well as on-line help etc, but I'm
sure that this can be done.
I'm building a db for a Swim Club. I'm recording Times/Dates/etc for each
Swimmer for around 39 diffent events. I'm recording the Minutes and Seconds
in two separate fields in a table and displaying them using =[sc50mB/Fly-m] &
":" & [sc50mB/Fly-s] as the Control in a TextBox. All OK so far.
To edit the time, I'm using a "EditTime" button for each event (39 buttons)
which brings up a form (EditSwimTime). I can use a different form for each
event (39 forms) but would rather use one.
This requires that pressing the button initiates variables for which the
value is passed to the EditSwimTime form.
My test button sets the variables using:
strCourse = "Short Course"
strLS = "sc"
strDist = "50m"
strStroke = "B/Fly"
I have created a new module and inserted code such as:
Global strCourse As String, strLS As String, strDist As String, strStroke As
String
Function GetCourse() As String
GetCourse = strCourse
End Function
I then use =GetCourse() in the Control of a TextBox on EditSwimTime & it all
works fine.
The problem is getting the time information from the table (there are two
tables that hold the times, ShortCourse and LongCourse)
I have created a function:
Function GetMinTime() As String
GetMinTime = strLS + strDist + strStroke + "-m"
End Function
I then use GetMinTime() as a Control in a TextBox on the EditSwimTime form,
but all it returns is sc50mB/Fly-m (the field that holds the Minitue value)
rather than returning the value in the field.
I have tried several differring structures, none of which work. I presume it
is incorrect syntax (maybee).
Any ideas?
Thanks in advance