G'day,
I have an unbound form that I want to use for adding records to one of a number of different tables according to the user needs. I do this by hiding/displaying different fields for different data (eg. Type of activity, Contact name). The Save button would have code that saves the data to the appropriate table (ie. Type of activity to tblActivities, etc). The problem I have is to detecting which field was made visible. So far I have the following code:
Private Sub cmdSave_Click()
Select Case ctl
Case "txtTitle"
If Me!txtTitle.Visible = True Then
MsgBox "title" ' Message to be replaced with proper code later
End If
Case "txtActivity"
If Me!txtActivity.Visible = True Then
MsgBox "activity" ' Message to be replaced with proper code later
End If
End Select
End Sub
When I press the save button nothing seems to happen. Any ideas?
thanks
Dave
I have an unbound form that I want to use for adding records to one of a number of different tables according to the user needs. I do this by hiding/displaying different fields for different data (eg. Type of activity, Contact name). The Save button would have code that saves the data to the appropriate table (ie. Type of activity to tblActivities, etc). The problem I have is to detecting which field was made visible. So far I have the following code:
Private Sub cmdSave_Click()
Select Case ctl
Case "txtTitle"
If Me!txtTitle.Visible = True Then
MsgBox "title" ' Message to be replaced with proper code later
End If
Case "txtActivity"
If Me!txtActivity.Visible = True Then
MsgBox "activity" ' Message to be replaced with proper code later
End If
End Select
End Sub
When I press the save button nothing seems to happen. Any ideas?
thanks
Dave