SubForm Not Updating

R3GUL8OR

New member
Local time
Today, 00:54
Joined
Mar 15, 2007
Messages
8
SubForm Not Updating From Drop Down

OK, This is weird. It was working last night, I made some changes before I left for the day and come in this morning to start using the database..BOOM! stoped working.

OK. So I have a table that keeps track of all the jobs for the week. All are organized by the DAY (primary key is autonumbered). So on the form, the user selects a day, say Monday, and the subform pulls up any jobs that were for Monday. My problem is, it updates the subform when on Tuesday. Any other day, nothing. Subform is blank. Any ideas???? my code is below, but I dont think it lies in there. The parent Link is set to DAY and child link also set to DAY. Ive even tried to put the REQUERY in every subfunction, but nothing.

Private Sub Save_Record_Click()

##### Error Checking and Stuff Removed #####

'Determines if a duplicate was found.
If Dup_Search <> "" Or Null Then
Match = "Y"
Else
Match = "N"
End If

Set RS = CurrentDb.OpenRecordset("Smartboard_Log")

With RS

If Match = "Y" Then

'Message context for the Message Box.
strMsg = "Site: " & Site_Search & vbCr & "System: " & _
System_Search & vbCr & "Problem: " & Problem_Search & _
" " & ProblemO_Search & vbCr & vbCr & "Update Record?"
If MsgBox(strMsg, vbYesNo + vbExclamation, "Update Record") = vbYes Then
'Deletes the old record in the Smartboard Table.
'Finds the correct record based on the record number.

Record_Search = RecallCombo

RS.Index = "PrimaryKey"
RS.Seek "=", Record_Search
RS.Edit

RS!Log_Date.Value = txt_date
RS!Julian_Date = txtJulian
RS!Log_Time = txt_time
If txtStopTime <> "" Then RS!Log_Stop_Time = txtStopTime
RS!Site.Value = cmbSite
If Me.frmSystem.Value = 1 Then RS!System = "ISST"
If Me.frmSystem.Value = 2 Then RS!System = "EHF"
If Me.frmSystem.Value = 3 Then RS!System = "AFSAT"
If Me.frmSystem.Value = 4 Then RS!System = "UHF"
If Me.frmProblem.Value = 1 Then RS!Problem = "Missed Daily"
If Me.frmProblem.Value = 2 Then RS!Problem = "Missed Comm Check"
If Me.frmProblem.Value = 3 Then
RS!Problem = "Other:"
RS![Problem (Other)] = txt_other
End If
If Me.frmProblem.Value = 4 Then
RS!Problem = "Dispatch:"
RS![Problem (Other)] = txtDispatch
End If
RS!Notes = txt_notes
RS!Fixed = chk_fixed
RS!Job_No = txtJob_No

RS.Update
Else
'Exits the function if the user selects No.
strMsg = "This record will not be updated. " & _
vbCr & "Please change the current information needing to be uploaded, if necessary."
MsgBox strMsg, vbOKOnly & vbInformation, "Record Not Added"
txt_date.SetFocus
RS.Close ' save resources
Set RS = Nothing ' save resources
Exit Sub
End If
Else
.AddNew

!Day = Current_Day
!Log_Date = txt_date
!Julian_Date = txtJulian
!Log_Time = txt_time
If txtStopTime <> "" Then !Log_Stop_Time = txtStopTime
!Site = Current_Site
!System = System_Text
!Problem = Problem_Text
![Problem (Other)] = txt_other
!Notes = txt_notes
!Fixed = chk_fixed
!Job_No = txtJob_No

.Update
End If

End With

Me.Smartboard_View.Requery
Me.RecallCombo.Requery

'Closes and saves the resources.
RS.Close
Set RS = Nothing

#####MORE JUNK REMOVED######

End Sub
 
Last edited:
ok now i feel stupid. the problem lied withthe parent and child links. Deleted the reference and all of the sudden, everything works.
 

Users who are viewing this thread

Back
Top Bottom