rgomez1999
Technical User
I followed an advice in the FAQ under the title, "How do I create a form that opens on a new record but allows edits" which works but there is an issue I could use your help with.
Here's the original FAQ Tip:
To have a data entry form that lets users start entering records but also easily go to existing records for editing do the following:
(This works only for forms that have a combo or listbox to look up and go to existing records. The wizard will do it, just select "find a record in my form. . .".)
Set the DataEntry property for the form to true/yes in the data section.
In the AfterUpdate event of the combo or listbox there will be wizard generated code to the effect of:
Dim rs as object
Set rs = me.recordset.clone
Before the Set statement put in the following line of code (you'll get an error if it comes after the Set statement):
Me.DataEntry = False
The form will go to an existing record when a selection is made in the list or combo and the navigation controls will be enabled (and show "Record _ of ___" for the total in the table).
============================================================
Back to Me Now
============================================================
This tips works perfectly for me with the exception that it does NOT allow me to pick my clients from the Combo Box and go to that specific record. The reason why I think is because on the main form's property under the On Current Event I have the following code which kept my combo box in synchronization with the navigational bars (left/right). The Code:
Private Sub Form_Current()
Combo1 = PatientID ' Update the Find A Record combo box.
End Sub
Now if I remove this code from the On Current event, the FAQ Tip works fine and I can choose my client and go to that specific record however when I use the navigational bars (left/right) it no longers synchronizes with the combo box. I'd like to keep this setup with both codes but don't know how. If you can help I'd appreciate it. Thanks.
PS: Without the tip the On Current event works beautiful with my combo box but I'd like the staff people to get to a blank record instead of a patient's data.
Here's the original FAQ Tip:
To have a data entry form that lets users start entering records but also easily go to existing records for editing do the following:
(This works only for forms that have a combo or listbox to look up and go to existing records. The wizard will do it, just select "find a record in my form. . .".)
Set the DataEntry property for the form to true/yes in the data section.
In the AfterUpdate event of the combo or listbox there will be wizard generated code to the effect of:
Dim rs as object
Set rs = me.recordset.clone
Before the Set statement put in the following line of code (you'll get an error if it comes after the Set statement):
Me.DataEntry = False
The form will go to an existing record when a selection is made in the list or combo and the navigation controls will be enabled (and show "Record _ of ___" for the total in the table).
============================================================
Back to Me Now
============================================================
This tips works perfectly for me with the exception that it does NOT allow me to pick my clients from the Combo Box and go to that specific record. The reason why I think is because on the main form's property under the On Current Event I have the following code which kept my combo box in synchronization with the navigational bars (left/right). The Code:
Private Sub Form_Current()
Combo1 = PatientID ' Update the Find A Record combo box.
End Sub
Now if I remove this code from the On Current event, the FAQ Tip works fine and I can choose my client and go to that specific record however when I use the navigational bars (left/right) it no longers synchronizes with the combo box. I'd like to keep this setup with both codes but don't know how. If you can help I'd appreciate it. Thanks.
PS: Without the tip the On Current event works beautiful with my combo box but I'd like the staff people to get to a blank record instead of a patient's data.