S
StuJol
i have a form linked to a tbl. when form is opened from the database window,
it defaults to the first record and can be edited. when the form is opened
from a command button on another form, the form cant be edited. no errors
just a sound from my pc.
i've created 2 codes to open this form. both codes wont allow me to edit
current record
Private Sub Command43_Click()
On Error GoTo Err_Command43_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_PlantLog_Add"
stLinkCriteria = "[Record_ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command43_Click:
Exit Sub
Err_Command43_Click:
Msgbox Err.Description
Resume Exit_Command43_Click
End Sub
++++++++++++++++++++++++++++++++
Function ViewCurrentLog() As Boolean
'Open Form
DoCmd.OpenForm "frm_PlantLog_Add", , , , , acHidden
'Select Form
Forms!frm_PlantLog_Add.SetFocus
'Select Last Record
DoCmd.GoToRecord , , acLast
'Display Form
DoCmd.OpenForm "frm_PlantLog_Add", acNormal, , , acFormEdit,
acWindowNormal
End Function
any help would be appreciated.
it defaults to the first record and can be edited. when the form is opened
from a command button on another form, the form cant be edited. no errors
just a sound from my pc.
i've created 2 codes to open this form. both codes wont allow me to edit
current record
Private Sub Command43_Click()
On Error GoTo Err_Command43_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_PlantLog_Add"
stLinkCriteria = "[Record_ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command43_Click:
Exit Sub
Err_Command43_Click:
Msgbox Err.Description
Resume Exit_Command43_Click
End Sub
++++++++++++++++++++++++++++++++
Function ViewCurrentLog() As Boolean
'Open Form
DoCmd.OpenForm "frm_PlantLog_Add", , , , , acHidden
'Select Form
Forms!frm_PlantLog_Add.SetFocus
'Select Last Record
DoCmd.GoToRecord , , acLast
'Display Form
DoCmd.OpenForm "frm_PlantLog_Add", acNormal, , , acFormEdit,
acWindowNormal
End Function
any help would be appreciated.