Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2003
    Location
    UK
    Posts
    78

    Unanswered: load and close a form a few times in succession

    I want to load a form more than once to capture passenger details. my code is:
    Dim stDocName As String
    Dim stLinkCriteria As String
    Dim i As Integer, ipaxToTravel
    stDocName = "frmCollectNames"
    ipaxToTravel = Val(Text66.Value) + Val(Text68.Value)
    stLinkCriteria = "BookingID=" & Me!bookingId
    For i = 1 To ipaxToTravel
    DoCmd.OpenForm stDocName, , , stLinkCriteria, , , ipaxToTravel
    Next i

    Trouble is it just executes once and thats it!!
    the light is on, someone is home, but they dont know they are. HELLO!

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    you can't open multiple instances of a form.

    have you considered "continuous forms": might get you close to where you want to go.

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Aug 2003
    Location
    UK
    Posts
    78
    Originally posted by izyrider
    you can't open multiple instances of a form.

    have you considered "continuous forms": might get you close to where you want to go.

    izy
    Thanks izy I will look into it
    the light is on, someone is home, but they dont know they are. HELLO!

  4. #4
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    It can be done use OO

    quote:
    --------------------------------------------------------------------------------
    Originally posted by izyrider
    you can't open multiple instances of a form.

    have you considered "continuous forms": might get you close to where you want to go.

    izy
    --------------------------------------------------------------------------------

    Ill give you the code later

    i allready told someone to do it and it worked

  5. #5
    Join Date
    Aug 2003
    Location
    UK
    Posts
    78

    Re: It can be done use OO

    Originally posted by Marvels
    quote:
    --------------------------------------------------------------------------------
    Originally posted by izyrider
    you can't open multiple instances of a form.

    have you considered "continuous forms": might get you close to where you want to go.

    izy
    --------------------------------------------------------------------------------

    Ill give you the code later

    i allready told someone to do it and it worked
    Thanks Marvels
    the light is on, someone is home, but they dont know they are. HELLO!

  6. #6
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    here it is

    Hello there this is as ive send it to the previus person so you'll have to change a few thigs (see point 3) to make it work 4 u



    1. Make a Module lets call it MdlOpenForm
    Where you declare something like this

    Public NewForm As New frmYourFormName '(this is the real form -> frmYourFormName)

    2. Under this make a : Public Sub Button_Press(pForm AS Form,SelctedItem_ID as Int)


    in this section you set the code that now is under the button, replace the Me (Me.Listbox) into pForm.Listbox

    'After thiscode
    instead of opening the "real form" , DoCmd open frmYourFormName
    You type : DoCmd open.pFrom

    3. Now in the buton click you set the following routine :

    for each MyListbox.SelctedItem

    MdlOpenForm.Button_Press(Me,SelctedItem_ID)

    next

    Cascade


    dapman2002 if you need more expl give a holler

    Greetz

  7. #7
    Join Date
    Aug 2003
    Location
    UK
    Posts
    78

    Re: here it is

    Originally posted by Marvels
    Hello there this is as ive send it to the previus person so you'll have to change a few thigs (see point 3) to make it work 4 u



    1. Make a Module lets call it MdlOpenForm
    Where you declare something like this

    Public NewForm As New frmYourFormName '(this is the real form -> frmYourFormName)

    2. Under this make a : Public Sub Button_Press(pForm AS Form,SelctedItem_ID as Int)


    in this section you set the code that now is under the button, replace the Me (Me.Listbox) into pForm.Listbox

    'After thiscode
    instead of opening the "real form" , DoCmd open frmYourFormName
    You type : DoCmd open.pFrom

    3. Now in the buton click you set the following routine :

    for each MyListbox.SelctedItem

    MdlOpenForm.Button_Press(Me,SelctedItem_ID)

    next

    Cascade


    dapman2002 if you need more expl give a holler

    Greetz
    Thanks Marvels,
    I am out for rest of day but will do this later
    the light is on, someone is home, but they dont know they are. HELLO!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •