Hi, in a form with editable records i have an image for changing to another similar form but with different features like uneditable records. For that i have the code:
Dim rsttt as Variant
Set rsttt = Me.recordSet
DoCmd.OpenForm "frmUneditable"
Set Forms!frmUneditable.recordSet = rsttt
DoCmd.Close acForm, "frmEditable"
This code opens the form frmUneditable and nothing appears in the browsing box and the browsing buttons Previous and Next are dissabled. For avoiding that, i have added to the end of the previous code:
Forms!frmUneditable.SetFocus
DoCmd.GoToRecord , , acGoTo, 1
DoCmd.Close acForm, "frmEditable"
But this makes that the focus goes 1. to the form frmUneditable, 2. to the form frmEditable, and 3. to the form frmUneditable.
I have tried this
Set rsttt = Me.RecordsetClone
instead of this
Set rsttt = Me.recordSet
but this causes another problem in the form frmUneditable: in its Form_Current event the code
Me.Id
gives the error "Can't go to the specified field", when Me.Id is a field without textbox, it is between the available fields but it isn't shown.
I would want to avoid the ugly method of adding a hidden textbox for that field.
Is there possible changes in the code that allow these purposes (transferring the recordset between forms and having enabled the browsing bar)?
Thanks in advance for any help given.
Dim rsttt as Variant
Set rsttt = Me.recordSet
DoCmd.OpenForm "frmUneditable"
Set Forms!frmUneditable.recordSet = rsttt
DoCmd.Close acForm, "frmEditable"
This code opens the form frmUneditable and nothing appears in the browsing box and the browsing buttons Previous and Next are dissabled. For avoiding that, i have added to the end of the previous code:
Forms!frmUneditable.SetFocus
DoCmd.GoToRecord , , acGoTo, 1
DoCmd.Close acForm, "frmEditable"
But this makes that the focus goes 1. to the form frmUneditable, 2. to the form frmEditable, and 3. to the form frmUneditable.
I have tried this
Set rsttt = Me.RecordsetClone
instead of this
Set rsttt = Me.recordSet
but this causes another problem in the form frmUneditable: in its Form_Current event the code
Me.Id
gives the error "Can't go to the specified field", when Me.Id is a field without textbox, it is between the available fields but it isn't shown.
I would want to avoid the ugly method of adding a hidden textbox for that field.
Is there possible changes in the code that allow these purposes (transferring the recordset between forms and having enabled the browsing bar)?
Thanks in advance for any help given.