aziz rasul
Active member
- Local time
- Today, 16:18
- Joined
- Jun 26, 2000
- Messages
- 1,935
I have a form called "frmGeneralEnquiries" which is opened to a new blank record with some mandatory fields. The record has not been filled yet.
On a combo box in the form's header I select 'Search Referrer' and press a command button, which opens another form called "frmReferrers". Having selected the referrer, I press a command button, which closes "frmReferrers" and passes the value of the referrer ID to "frmGeneralEnquiries". Here's the code: -
The problem I have is that when a record in "frmGeneralEnquiries" is complete and I select a referrer (which is not a mandatory field), there is no problem because it will go to the previous record and then move forward OK which refreshes the referrer ID value. However if the record in "frmGeneralEnquiries" is incomplete in part or whole, I get an error at line
DoCmd.GoToRecord acDataForm, "frmGeneralEnquiries", acPrevious saying can't go to specified record because the mandatory fields are not complete. Is there a another way of refreshing the record in "frmGeneralEnquiries" WITHOUT having to move records?
On a combo box in the form's header I select 'Search Referrer' and press a command button, which opens another form called "frmReferrers". Having selected the referrer, I press a command button, which closes "frmReferrers" and passes the value of the referrer ID to "frmGeneralEnquiries". Here's the code: -
Code:
DoCmd.Close acForm, Screen.ActiveForm.Name
Forms!frmGeneralEnquiries.txtreferralid = intReferrerID
Forms!frmGeneralEnquiries.txtreferralid.Visible = True
DoCmd.GoToRecord acDataForm, "frmGeneralEnquiries", acPrevious
DoCmd.GoToRecord acDataForm, "frmGeneralEnquiries", acNext
The problem I have is that when a record in "frmGeneralEnquiries" is complete and I select a referrer (which is not a mandatory field), there is no problem because it will go to the previous record and then move forward OK which refreshes the referrer ID value. However if the record in "frmGeneralEnquiries" is incomplete in part or whole, I get an error at line
DoCmd.GoToRecord acDataForm, "frmGeneralEnquiries", acPrevious saying can't go to specified record because the mandatory fields are not complete. Is there a another way of refreshing the record in "frmGeneralEnquiries" WITHOUT having to move records?