Randall Anthony
randall.anthony at cox.net
Sat Jan 26 13:35:55 CST 2008
I've done that, when it hits the openargs on form B, it goes to the oncurrent event. I've placed the me.recordsource in the the current event, it still doesn't set it. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Saturday, January 26, 2008 2:29 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Cannot set recordsource on Load Event set a breakpoint at the beginning of the Form B load event and step through the code looking at the values. Might reveal where it's going wrong. Also, run both record source queries from the QBE grid to make sure they give diriment results. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of RANDALL R ANTHONY Sent: Saturday, January 26, 2008 11:12 AM To: Database Advisors Group Subject: [AccessD] Cannot set recordsource on Load Event Greetings, Im vexed by a problem Im having with a form. A97. On form A, I have a Do.Cmd etc, and passing an openarg value of 1 or 2. On form B, I have an on load event to evaluate the openarg and set the recordsource. This is obviously not working as the form opens with all the records displayed. If I set the recordsource in the properties window, it works fine. What am I missing? TIA. Form A DoCmd.OpenForm "Audit Entry", acNormal, , Criteria, , , "1" Form B Private Sub Form_Load() Dim iBusUnit As Integer iBusUnit = Me.Form.OpenArgs If iBusUnit = 1 Me.RecordSource = "Audit_Data_Med" Else Me.RecordSource = "Audit_Data_MH" End If End Sub -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.11/1244 - Release Date: 1/25/2008 7:44 PM -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com