Microsoft Office Forums


Reply
Thread Tools Display Modes

How do I pass a parameter to an unbound form?

 
 
AkAlan via AccessMonster.com
Guest
Posts: n/a
 
      11-05-2008, 11:18 PM
I have a form with 3 continuous subforms that each have textboxes. Sometimes
they have more data than can be shown without making the textbox relly large.
I want to have the user doubleclick the text box to open another form with a
really large textbox and dynamically supply the recordsource and criteria. I
will post the event code that I am trying to make work. All I get is a blank
form. Any help would be great.

Dim stDocName As String
Dim stLinkCriteria As String
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord

Form_frmCarTextPopUp.RecordSource = "q_QcCarDiscrepancy"
Form_frmCarTextPopUp.txtExpanded.ControlSource = "Discrepancy"
stDocName = "frmCarTextPopUp"
stLinkCriteria = "[CarInspNum]=" & "'" & Me![txtCarNum] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...oding/200811/1

 
Reply With Quote
 
 
 
 
Beetle
Guest
Posts: n/a
 
      11-06-2008, 12:09 AM
I don't believe you can assign the recordsource, or the control source
of any of the controls, until after the form is opened. That also means
you won't be able to apply any criteria until afterwards either. You might
try something like;


DoCmd.OpenForm "frmCarTextPopUp", , , , acFormReadOnly

With Forms!frmCarTextPopUp
.RecordSource = "q_QcCarDiscrepancy"
.Controls("txtExpanded").ControlSource = "Discrepancy"
.Filter = "[CarInspNum]=""" & Me![txtCarNum] & """"
.FiltetOn = True
End With


--
_________

Sean Bailey


"AkAlan via AccessMonster.com" wrote:

> I have a form with 3 continuous subforms that each have textboxes. Sometimes
> they have more data than can be shown without making the textbox relly large.
> I want to have the user doubleclick the text box to open another form with a
> really large textbox and dynamically supply the recordsource and criteria. I
> will post the event code that I am trying to make work. All I get is a blank
> form. Any help would be great.
>
> Dim stDocName As String
> Dim stLinkCriteria As String
> If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
>
> Form_frmCarTextPopUp.RecordSource = "q_QcCarDiscrepancy"
> Form_frmCarTextPopUp.txtExpanded.ControlSource = "Discrepancy"
> stDocName = "frmCarTextPopUp"
> stLinkCriteria = "[CarInspNum]=" & "'" & Me![txtCarNum] & "'"
> DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...oding/200811/1
>
>

 
Reply With Quote
 
 
 
 
AkAlan via AccessMonster.com
Guest
Posts: n/a
 
      11-06-2008, 12:24 AM
I tried it but it opened a different record and errored on the .filteron =
true.

Beetle wrote:
>I don't believe you can assign the recordsource, or the control source
>of any of the controls, until after the form is opened. That also means
>you won't be able to apply any criteria until afterwards either. You might
>try something like;
>
> DoCmd.OpenForm "frmCarTextPopUp", , , , acFormReadOnly
>
> With Forms!frmCarTextPopUp
> .RecordSource = "q_QcCarDiscrepancy"
> .Controls("txtExpanded").ControlSource = "Discrepancy"
> .Filter = "[CarInspNum]=""" & Me![txtCarNum] & """"
> .FiltetOn = True
> End With
>
>> I have a form with 3 continuous subforms that each have textboxes. Sometimes
>> they have more data than can be shown without making the textbox relly large.

>[quoted text clipped - 12 lines]
>> stLinkCriteria = "[CarInspNum]=" & "'" & Me![txtCarNum] & "'"
>> DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...oding/200811/1

 
Reply With Quote
 
AkAlan via AccessMonster.com
Guest
Posts: n/a
 
      11-06-2008, 12:45 AM
I'm not sure it matters but I am using an ADP

Beetle wrote:
>I don't believe you can assign the recordsource, or the control source
>of any of the controls, until after the form is opened. That also means
>you won't be able to apply any criteria until afterwards either. You might
>try something like;
>
> DoCmd.OpenForm "frmCarTextPopUp", , , , acFormReadOnly
>
> With Forms!frmCarTextPopUp
> .RecordSource = "q_QcCarDiscrepancy"
> .Controls("txtExpanded").ControlSource = "Discrepancy"
> .Filter = "[CarInspNum]=""" & Me![txtCarNum] & """"
> .FiltetOn = True
> End With
>
>> I have a form with 3 continuous subforms that each have textboxes. Sometimes
>> they have more data than can be shown without making the textbox relly large.

>[quoted text clipped - 12 lines]
>> stLinkCriteria = "[CarInspNum]=" & "'" & Me![txtCarNum] & "'"
>> DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly


--
Message posted via http://www.accessmonster.com

 
Reply With Quote
 
Dennis
Guest
Posts: n/a
 
      11-06-2008, 05:15 PM
I usually just code that in VBA, using ADO lookup methodology. Works like a
charm.

"AkAlan via AccessMonster.com" wrote:

> I have a form with 3 continuous subforms that each have textboxes. Sometimes
> they have more data than can be shown without making the textbox relly large.
> I want to have the user doubleclick the text box to open another form with a
> really large textbox and dynamically supply the recordsource and criteria. I
> will post the event code that I am trying to make work. All I get is a blank
> form. Any help would be great.
>
> Dim stDocName As String
> Dim stLinkCriteria As String
> If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
>
> Form_frmCarTextPopUp.RecordSource = "q_QcCarDiscrepancy"
> Form_frmCarTextPopUp.txtExpanded.ControlSource = "Discrepancy"
> stDocName = "frmCarTextPopUp"
> stLinkCriteria = "[CarInspNum]=" & "'" & Me![txtCarNum] & "'"
> DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...oding/200811/1
>
>

 
Reply With Quote
 
AkAlan via AccessMonster.com
Guest
Posts: n/a
 
      11-06-2008, 06:37 PM
Do you have an example? Thanks.

Dennis wrote:
>I usually just code that in VBA, using ADO lookup methodology. Works like a
>charm.
>
>> I have a form with 3 continuous subforms that each have textboxes. Sometimes
>> they have more data than can be shown without making the textbox relly large.

>[quoted text clipped - 12 lines]
>> stLinkCriteria = "[CarInspNum]=" & "'" & Me![txtCarNum] & "'"
>> DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly


--
Message posted via http://www.accessmonster.com

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unbound FORM with radio or toggle button to pass a parameter to qu AFSSkier Access Forms 7 09-24-2008 01:54 AM
Pass Parameter to stored procedure in pass thru query SAC Access Queries 7 07-11-2007 11:49 AM
Pass a parameter to a parameter query from a data access page Matt Access Queries 10 08-16-2006 01:52 PM
Pass parameter to a parameter query from a data access page Matt Access General 0 08-11-2006 05:18 PM
error STOP:0x0000007B (parameter, parameter, parameter, parameter) robert35 Access Beginners 1 12-15-2004 03:28 PM


All times are GMT. The time now is 09:16 PM.
Microsoft Office Forums is not affiliated with Microsoft Corporation.


Welcome!
Welcome to the Microsoft Office Forums
 


Latest Threads
New user looking for shapes/templates
SargeUSMC (04-21-2014, 04:23 PM)

Mail Merging Content With High Quality
oleander (04-17-2014, 11:59 PM)

Aargh. What is this?
PeteJ (04-17-2014, 12:10 PM)

Word 2013 Insert Symbol (Not Responding)
tpthrshr (04-17-2014, 02:49 AM)

Can't save a large Word document
Josh (04-17-2014, 01:03 AM)