Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft Access > Re: open form w...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 30646 of 31273
Post > Topic >>

Re: open form with a different recordsource

by Salad <oil@[EMAIL PROTECTED] > Jul 3, 2008 at 12:16 PM

RLN wrote:
> RE: Access 2003
> 
> I have a SQL variable (strSQL1 dimmed as String) that gets built using
> Select Case logic.  The first half of strSQL1 is etched in stone no
> matter what.
> The 2nd half of strSQL1 (the condition) is built depending on which
> option button is chosen:
> For option 1, I add "Condition X" to the end of strSQL1.
> For option 2, I add "Condition Y" to the end of strSQL1...etc.
> 
> When the Select Case logic is completed strSQL1 is built and I then need
> to launch a form in Datasheet mode using strSQL1 as my data source.
> 
> Can this be done?
> 
> 
> *** Sent via Developersdex http://www.developersdex.com
***

I suppose you could launch and change the source.
     DoCmd.OpenForm "FormName", , , , , , strSQL1

Now in the OnOpen even you could do
	If Not IsNull(me.openargs) then Me.Recordsource = Me.OpenArgs

But I don't see the necessity because the table info isn't 
changing...just the filter.  Let's say you simply make strSQL1 the 
conditional then pass the filter.  Ex:
	strSQL1 = "customerid = 123".
	DoCmd.OpenForm "FormName", , , strSQL1
and this will open it to filtered records where customerid = 123

Once in a form, you could do things like this
	Me.Filter = "CustomerID = 123"
	Me.FilterOn = True

Powerful
http://www.youtube.com/watch?v=YhrLBrDzj5Q
 




 5 Posts in Topic:
open form with a different recordsource
RLN <nospamrln@[EMAIL   2008-07-03 14:00:26 
Re: open form with a different recordsource
Salad <oil@[EMAIL PROT  2008-07-03 12:16:26 
Re: open form with a different recordsource
RLN <nospamrln@[EMAIL   2008-07-03 15:01:25 
Re: open form with a different recordsource
Salad <oil@[EMAIL PROT  2008-07-03 15:02:22 
Re: open form with a different recordsource
RLN <nospamrln@[EMAIL   2008-07-08 10:47:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 17:58:13 CDT 2008.