Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Jul 2003
    Posts
    292

    Unanswered: pulling specific fields on enter

    HI,

    I have a form which has a subform inside.. In this sub-form I have my table of records.. each of these records has sub-records .. What I want to do is.. let the user highlight whichever record he/she wants to see sub-records for.. each record has 7 fields.. out of those 7.. 3 of those fields make the record unique.. hit enter and a window would pop up with those particular sub-records ..

    I fairly new .. soo if youcould explain in detail.. that would be great..


    thanks

  2. #2
    Join Date
    Jul 2003
    Posts
    292
    I have an idea.. Is there a way If the user highlights.. a specific record on the subform... it could check back against my query if there are a match of the 3 unique fields.. display all that match ??

    thanks

  3. #3
    Join Date
    Sep 2003
    Posts
    19

    Re: pulling specific fields on enter

    Your "window" that pops up with the records needs to be a popup form. Bind the form to a query. The query should have the table you want as its source and 3 criteria. You can put Forms!Mainform!field1 as criteria1. Forms!Mainform!field2 as criteria2. etc. On the double click event of the field on the mainform, requery the popup form.

  4. #4
    Join Date
    Jul 2003
    Posts
    292
    wow this is soo overwhelming.. thanks alot.. !

    I am new so please care with me.. ok this is what i have so far.. and this is what I have done.. I have a form with a subform inside... in my subform I have a table with all my records displayed.. I found a way to capture the enter button.. that way all the user has to do is .. highlight the record.. hit enter and the data will pop up..

    You said to bind the form with the query.. do you mean create some fields in my new form that will display the subrecords ?.. what your suggesting .. will this bring back just one sub-record ?? I'm sorry I meant to explain better.. on one record their could be more than one sub-record..

    or will what you suggested bring back more than one sub-record..

    sorry im a bit confused

    thanks

  5. #5
    Join Date
    Sep 2003
    Posts
    19
    It sounds like your main form w/ subform is correct already. When the user selects a record on the subform, instead of having a window popup, have a 3rd form popup. When you create a form, one of the formating options is "popup form". If you set that to true, it will look just like a popup window. The recordsource of the 3rd form whould be a query. You will need to create the query in design view. Select the table you want and then in the criteria line, refer to your subform. For example, one of your criteria might be Forms!Mainformname!Subformname.form!Field1Name. Use 3 criteria since there are 3 things that make the record unique. When the user hits enter or double click, makle the event say Form3.requery. Your popup form will then display as many records as meet the criteria you specified.

  6. #6
    Join Date
    Jul 2003
    Posts
    292
    hmmm i must be doing something wrong.. ARgh..

    sorry I'm feeling slow today... I created a form "frmInspectionPop".. binded it with my query "qryrecord".. in my query i must be doing something wrong there.. when i run the query.. i get a pop up box that usually comes up when a name is not correct.. i double check, names are correct..

    I've attached a copy of my .mdb if you wanted to take a look..

    thanks
    Last edited by TonyT; 09-26-03 at 15:49.

  7. #7
    Join Date
    Sep 2003
    Posts
    19
    in your criteria, put a space between tblqr and subform. You need to refer to the name of the control on the form (tblqr subform) not the actual subform's name (tblqrsubform)


    Originally posted by TonyT
    hmmm i must be doing something wrong.. ARgh..

    sorry I'm feeling slow today... I created a form "frmInspectionPop".. binded it with my query "qryrecord".. in my query i must be doing something wrong there.. when i run the query.. i get a pop up box that usually comes up when a name is not correct.. i double check, names are correct..

    I've attached a copy of my .mdb if you wanted to take a look..

    thanks

  8. #8
    Join Date
    Jul 2003
    Posts
    292
    Hey Yoda,

    Thanks.. it seems to be working.. but is there a way to display all records .. instead of having to scroll to the next ?..

    thanks for the help

  9. #9
    Join Date
    Sep 2003
    Posts
    19
    Set your form view to "continuous forms" & add scroll bars on the formatting tab. You will want to move your fields closer together so it looks more like an excel worksheet.

    Originally posted by TonyT
    Hey Yoda,

    Thanks.. it seems to be working.. but is there a way to display all records .. instead of having to scroll to the next ?..

    thanks for the help

  10. #10
    Join Date
    Jul 2003
    Posts
    292
    got it..! thanks soo much for your time !

  11. #11
    Join Date
    Jul 2003
    Posts
    292
    I do have one more question if you dont mind..

    On a forms caption.. Is there a way I can add the unique field names to that title .. instead of having it repeat how ever many times there are subrecords..

    that way I can display once the title say...

    on the caption of the form..

    "Sub-Record : Unique Field1, Unique Field2, Unique Field3"

    and underneath all that would be listed would be the sub-record info?

    thanks you been great help!

  12. #12
    Join Date
    Sep 2003
    Posts
    19
    On the on open event of the form you can do me.caption = "Whatever you want it to say" Me.repaint.

    No problem. :-)

    Originally posted by TonyT
    I do have one more question if you dont mind..

    On a forms caption.. Is there a way I can add the unique field names to that title .. instead of having it repeat how ever many times there are subrecords..

    that way I can display once the title say...

    on the caption of the form..

    "Sub-Record : Unique Field1, Unique Field2, Unique Field3"

    and underneath all that would be listed would be the sub-record info?

    thanks you been great help!

  13. #13
    Join Date
    Jul 2003
    Posts
    292
    I inserted the code you said.. on the on open.. and got a syntax error..

    Code:
    me.caption = "Inspections" Me.repaint

    thanks

  14. #14
    Join Date
    Sep 2003
    Posts
    19
    It should be 2 seperate lines. Sorry.

    Originally posted by TonyT
    I inserted the code you said.. on the on open.. and got a syntax error..

    Code:
    me.caption = "Inspections" Me.repaint

    thanks

  15. #15
    Join Date
    Jul 2003
    Posts
    292
    thanks yoda..

    ok that got rid of the syntax error.. and it displayed what i wanted to see inside the quotes.. but how do i add my fields on there...

    that way i can take off the fields "strArea", "strProject", and "strReference" on my form..

    what it be something like..

    me.caption = "Inspections" & strArea
    Me.repaint

    thanks

Posting Permissions

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