[AccessD] Cannot set recordsource on Load Event

Dan Waters dwaters at usinternet.com
Sat Jan 26 15:10:18 CST 2008



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Randall Anthony
Sent: Saturday, January 26, 2008 1:55 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Cannot set recordsource on Load Event

So, setting the recordsource (no matter where) triggers the oncurrent?
	- Yes

Therefore bypassing the set criteria?
	- I don't know what your question is.  Try setting breakpoints at
each 
	Instance of setting the recordsource and another one at the Current 
	Event to see how it works out.

Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Saturday, January 26, 2008 2:51 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Cannot set recordsource on Load Event

Randall,

You can't put me.recordsource in the Current event because setting
me.recordsource will trigger the current event.

Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Randall Anthony
Sent: Saturday, January 26, 2008 1:36 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Cannot set recordsource on Load Event

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


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list