G
Guest
2 issues, one is a coding issue and one I think I may be able to fix with code.
1. I have a form (frmContact) where users enter time sheet data. Time is
broken down into 7 different categories and into .5 hour increments within
those categories. Each category is displayed as a list box. When a user
enters time into the list boxes, the time they chose is highlighted. If they
go on to a new record, and then back to the previous record to view or edit
it, the time they chose is no longer highlighted, so they have no way of
knowing the time that is being held in that record. That isn't true all the
time though. For example, occasionally the time they chose in certain
categories will still be highlighted, while the time chosen in the list box
next to it is not highlighted. The record is definately being saved (I
checked the table to be sure) What's going on there? It appears to be a
fluke with no real rhyme or reason. Is there a way to code it so that the
time they chose is always highlighted or is there a specific reason behind
this that has an easier fix?
2. The same form (frmContact) has a label (being used as a command button)
on it that has the following code behind it:
Private Sub Label43_Click()
Dim stLinkCriteria As String
If IsNull(dtmDate) Then
Me.dtmDate.BackColor = 255
If MsgBox("The date field is null. Closing this form without a date
will delete this record." & vbNewLine & "If you wish to proceed click OK." &
vbNewLine & "If you wish to enter a date, Click Cancel.", vbOKCancel,
"WARNING!") = vbCancel Then
Cancel = True
Me.dtmDate.SetFocus
Else: DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
stLinkCriteria = "[ClientCaseInfoId]= " & Me![ClientCaseInfoID]
DoCmd.OpenForm "frmSummary", , , stLinkCriteria, , , ClientCaseInfoID
End If
End If
End Sub
The scenario I envisioned for the command button was that there would be
times when there would be no time and no date entered in the list boxes on
frmContact and it would be used simply as a way to pass the ClientCaseInfoID
into frmSummary. At other times there WOULD be time and a date listed on
frmContact, so that the current record would be saved and THEN the
ClientCaseInfoID would be passed into frmSummary. When a date is not
entered, the code works fine. But, if there is a date entered, the event
behind the label doesn't seem to fire. In other words, frmSummary does not
open. I HAVE to be in a record that has no data (other than the
ClientCaseInfoID) entered in order for frmSummary to open when I click the
label.
Any help is appreciated!
1. I have a form (frmContact) where users enter time sheet data. Time is
broken down into 7 different categories and into .5 hour increments within
those categories. Each category is displayed as a list box. When a user
enters time into the list boxes, the time they chose is highlighted. If they
go on to a new record, and then back to the previous record to view or edit
it, the time they chose is no longer highlighted, so they have no way of
knowing the time that is being held in that record. That isn't true all the
time though. For example, occasionally the time they chose in certain
categories will still be highlighted, while the time chosen in the list box
next to it is not highlighted. The record is definately being saved (I
checked the table to be sure) What's going on there? It appears to be a
fluke with no real rhyme or reason. Is there a way to code it so that the
time they chose is always highlighted or is there a specific reason behind
this that has an easier fix?
2. The same form (frmContact) has a label (being used as a command button)
on it that has the following code behind it:
Private Sub Label43_Click()
Dim stLinkCriteria As String
If IsNull(dtmDate) Then
Me.dtmDate.BackColor = 255
If MsgBox("The date field is null. Closing this form without a date
will delete this record." & vbNewLine & "If you wish to proceed click OK." &
vbNewLine & "If you wish to enter a date, Click Cancel.", vbOKCancel,
"WARNING!") = vbCancel Then
Cancel = True
Me.dtmDate.SetFocus
Else: DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
stLinkCriteria = "[ClientCaseInfoId]= " & Me![ClientCaseInfoID]
DoCmd.OpenForm "frmSummary", , , stLinkCriteria, , , ClientCaseInfoID
End If
End If
End Sub
The scenario I envisioned for the command button was that there would be
times when there would be no time and no date entered in the list boxes on
frmContact and it would be used simply as a way to pass the ClientCaseInfoID
into frmSummary. At other times there WOULD be time and a date listed on
frmContact, so that the current record would be saved and THEN the
ClientCaseInfoID would be passed into frmSummary. When a date is not
entered, the code works fine. But, if there is a date entered, the event
behind the label doesn't seem to fire. In other words, frmSummary does not
open. I HAVE to be in a record that has no data (other than the
ClientCaseInfoID) entered in order for frmSummary to open when I click the
label.
Any help is appreciated!