Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Passing Arguements

Discussion in 'Information Technology' started by DaBartman, Jul 28, 2006.

  1. DaBartman

    DaBartman
    Expand Collapse
    Guest

    I need some help in passing numeric data from a textbox and textual data from
    a form ( the text data) that has a subform textbox (numeric data) to one
    other new form when I open the new form. I plan on using the cmd.OpenForm
    "FormName", That's as far as I get. Have spent
    90 minutes reeading help files and am just as lost as when I started. Can
    this even be done? Hope I explained what I am trying to do well enough to get
    some feedback.
    Bart

    PS This is the second time I have posted this problem. The first time I
    erred by forgetting to state the info about the subform. Even with that
    stupid error on my part I got feed back that allowed me to pass the data from
    the main form successfully. Have spent the last 2-1/2 hours trying to get the
    second part to work. Just keep getting the same error telling me Access
    cannot find the subform (it's name). Sure hope you guys know if this is even
    possible. Has to be a work around someway, else many, many hours of coding go
    bye, bye:(

    Bart
     
  2. Loading...


  3. Joey Archer

    Joey Archer
    Expand Collapse
    Guest

    You can do this....once you type....

    docmd.open "formname"

    then type.....

    form_form2.textbox.text = form_form1.textbox.text (form2 being the form
    where you want the text passed to....form1 is the original form where the
    text is being passed from. Only replace the "form1", "form2" and "textbox"
    parts of the phrase. Leave the "form_")

    then for the subform I believe it's......

    form_form2.textbox.text = form_form1.subform.form!textbox

    This should work...let me now if it doesn't. I've used generic names
    (obviously) for your forms.

    "DaBartman" wrote:

    > I need some help in passing numeric data from a textbox and textual data from
    > a form ( the text data) that has a subform textbox (numeric data) to one
    > other new form when I open the new form. I plan on using the cmd.OpenForm
    > "FormName", That's as far as I get. Have spent
    > 90 minutes reeading help files and am just as lost as when I started. Can
    > this even be done? Hope I explained what I am trying to do well enough to get
    > some feedback.
    > Bart
    >
    > PS This is the second time I have posted this problem. The first time I
    > erred by forgetting to state the info about the subform. Even with that
    > stupid error on my part I got feed back that allowed me to pass the data from
    > the main form successfully. Have spent the last 2-1/2 hours trying to get the
    > second part to work. Just keep getting the same error telling me Access
    > cannot find the subform (it's name). Sure hope you guys know if this is even
    > possible. Has to be a work around someway, else many, many hours of coding go
    > bye, bye:(
    >
    > Bart
     
  4. DaBartman

    DaBartman
    Expand Collapse
    Guest

    Thank yoy Joey. It id after 1 am right now so will wait until thr morning to
    give it a try. If I fail, I will reply to this post again with the full code
    I have written. Hope I don't have to do this as it will be somewhat lengthy.
    If I get it work, I'll reply also, but with a big high five! Muvh thanks,
    Bart

    "Joey Archer" wrote:

    > You can do this....once you type....
    >
    > docmd.open "formname"
    >
    > then type.....
    >
    > form_form2.textbox.text = form_form1.textbox.text (form2 being the form
    > where you want the text passed to....form1 is the original form where the
    > text is being passed from. Only replace the "form1", "form2" and "textbox"
    > parts of the phrase. Leave the "form_")
    >
    > then for the subform I believe it's......
    >
    > form_form2.textbox.text = form_form1.subform.form!textbox
    >
    > This should work...let me now if it doesn't. I've used generic names
    > (obviously) for your forms.
    >
    > "DaBartman" wrote:
    >
    > > I need some help in passing numeric data from a textbox and textual data from
    > > a form ( the text data) that has a subform textbox (numeric data) to one
    > > other new form when I open the new form. I plan on using the cmd.OpenForm
    > > "FormName", That's as far as I get. Have spent
    > > 90 minutes reeading help files and am just as lost as when I started. Can
    > > this even be done? Hope I explained what I am trying to do well enough to get
    > > some feedback.
    > > Bart
    > >
    > > PS This is the second time I have posted this problem. The first time I
    > > erred by forgetting to state the info about the subform. Even with that
    > > stupid error on my part I got feed back that allowed me to pass the data from
    > > the main form successfully. Have spent the last 2-1/2 hours trying to get the
    > > second part to work. Just keep getting the same error telling me Access
    > > cannot find the subform (it's name). Sure hope you guys know if this is even
    > > possible. Has to be a work around someway, else many, many hours of coding go
    > > bye, bye:(
    > >
    > > Bart
     
  5. Arvin Meyer [MVP]

    Arvin Meyer [MVP]
    Expand Collapse
    Guest

    The correct syntax for referring to a control on a subform is:

    Forms!FormName!SubformName.Form!TextBoxName

    or in code you can also use:

    Me!SubformName.Form!TextBoxName

    Be sure to use square brackets around names with spaces in them, like:

    [Form Name]

    You can use the default value property of the control in the new form to
    read the value from the first form like:

    =Forms!FormName!SubformName.Form!TextBoxName
    --
    Arvin Meyer, MCP, MVP
    Microsoft Access
    Free Access downloads
    http://www.datastrat.com
    http://www.mvps.org/access

    "DaBartman" <DaBartman@discussions.microsoft.com> wrote in message
    news:773C7878-385C-4B7B-BAA3-D28BD581C817@microsoft.com...
    > I need some help in passing numeric data from a textbox and textual data

    from
    > a form ( the text data) that has a subform textbox (numeric data) to one
    > other new form when I open the new form. I plan on using the

    cmd.OpenForm
    > "FormName", That's as far as I get. Have spent
    > 90 minutes reeading help files and am just as lost as when I started. Can
    > this even be done? Hope I explained what I am trying to do well enough to

    get
    > some feedback.
    > Bart
    >
    > PS This is the second time I have posted this problem. The first time I
    > erred by forgetting to state the info about the subform. Even with that
    > stupid error on my part I got feed back that allowed me to pass the data

    from
    > the main form successfully. Have spent the last 2-1/2 hours trying to get

    the
    > second part to work. Just keep getting the same error telling me Access
    > cannot find the subform (it's name). Sure hope you guys know if this is

    even
    > possible. Has to be a work around someway, else many, many hours of coding

    go
    > bye, bye:(
    >
    > Bart
     

Share This Page