Hi, I have a form which looks like a weekly calendar (from Monday to Friday) and the Record is shown according to the date it was assigned.
There is a function on that form where I can drag and drop the Record from one day to the other.
The function works well with no error, but then I duplicated the form because we are combining data from two different locations.
The original Form is named frmRunde and the duplicated one is frmRundeMUC.
The only problem here is that the drag and drop function does not work on the second form. It is due to the VBA code in modMaussteureung (modeMouseControl) because there is a section where the form is updated.
Below is the code for that section:
At first when I tried to drag the record on frmRundeMUC, the error pop-up with the code in Yellow.
Then I added the other line in Red, but it then says the "Forms!frmRunde.requerySubforms" cannot be found.
Does it means that I can't put the Forms!frm___.requerySubforms sumultaneously together?
Sorry if the codes give you headache because it is in German.
There is a function on that form where I can drag and drop the Record from one day to the other.
The function works well with no error, but then I duplicated the form because we are combining data from two different locations.
The original Form is named frmRunde and the duplicated one is frmRundeMUC.
The only problem here is that the drag and drop function does not work on the second form. It is due to the VBA code in modMaussteureung (modeMouseControl) because there is a section where the form is updated.
Below is the code for that section:
Code:
Public Sub updateMessauftrag(ByVal pMA As Long, ByVal pDate As Date, Optional ByVal pAnlage As Long = 0)
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM qryEinordnungMA WHERE lngMessauftragNr = " & pMA & ";")
[COLOR="lime"]'Dates[/COLOR]
If (rs!indMessaufgabe <= 2) Then 'Analysemessung muss zunächst abgefangen werden, da sons Null-Fehler durch Leeres datEinarbeitIst
CurrentDb.Execute "UPDATE tblMessauftrag SET datMessungSoll = #" & datConvert(pDate) & "# WHERE lngMessauftragNr = " & pMA & ";"
ElseIf arbeitstageAddieren(rs!datEinarbeitIst, getKPI("Messung", False)) = pDate Then
CurrentDb.Execute "UPDATE tblMessauftrag SET datMessungSoll = NULL WHERE lngMessauftragNr = " & pMA & ";"
Else
CurrentDb.Execute "UPDATE tblMessauftrag SET datMessungSoll = #" & datConvert(pDate) & "# WHERE lngMessauftragNr = " & pMA & ";"
End If
[COLOR="Lime"]'Measuring Equipment[/COLOR]
If (pAnlage <> 0) Then
If (rs!indEMMessanlage = pAnlage) Then
CurrentDb.Execute "UPDATE tblMessauftrag SET indAbweichendeMessanlage = NULL, indAbweichenderMessraum = NULL WHERE lngMessauftragNr = " & pMA & ";"
Else
CurrentDb.Execute "UPDATE tblMessauftrag SET indAbweichendeMessanlage = " & pAnlage & ", indAbweichenderMessraum = " & DLookup("indMessraum", "tblMessanlage", "ID = " & pAnlage) & " WHERE lngMessauftragNr = " & pMA & ";"
End If
End If
[COLOR="Yellow"]Forms!frmRunde.requerySubforms[/COLOR]
[COLOR="Red"]Forms!frmRundeMUC.requerySubforms[/COLOR]
End Sub
At first when I tried to drag the record on frmRundeMUC, the error pop-up with the code in Yellow.
Then I added the other line in Red, but it then says the "Forms!frmRunde.requerySubforms" cannot be found.
Does it means that I can't put the Forms!frm___.requerySubforms sumultaneously together?
Sorry if the codes give you headache because it is in German.