Hay all. I will try to make this as simple as possible, but I know you need as much info as well: ;-)
I have a main form that has a comboBox(cmdMemberName) the has member first and last name orderBy last name, which is the first field in the dropdown.
I have two buttons on the presently (will add 'delete' button later): one is cmdEditMember the other is cmdNewMember.
I was working with at tutorial that uses the following code:
DoCmd.RunCommand acCmdRecordsGoToNew Me.mbr_LastName = " "
Call cmdEditMember_Click
That would work fine if I was in datasheet view or the my current focus was on a record within that data sheet, but I'm using a comboBox to populate a subform. I'm not trying to change any of the values in the subform, just the member list within the cmbBox.
Using the code above, the idea here is that the current form would create a new record when cmdNewMember is clicked; fill in [LastName] with a blank value; then cmdEditMember would extract the openArg value to goto to the new record.
This won't work for me cause I'm using a comboBox, and it doesn't allow edit in that manner - not to mention that the 'notOnList' event would trigger; additionally, if there was a way to do it using the comboBox properties, it would probably be lengthy. That-being-said:
DoCmd.Close acForm, "frmMbrDonation"
DoCmd.OpenForm (frmMemberInfo,acNormal,,,acFormAdd,acWindowNormal ,,)
I was trying to open it using the cmdNewMember button to open the form and set it to a new record. I've tried the above code but I get an error (Compile error: Expected expression)
Thanks