Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    15

    Unanswered: form within a form

    I would like to have a form within the main form. This "inside form" should display the contents of two sets of up-to five combo-box set selections. These selections, based on nineteen different tables, will be mirrored in text boxes, from which the code will determine the user's parameters.

    My question, then, is: how might I go about displaying the results of those parameters in an interior box? What code should I use? I have the results in a form view, currently, but I'm not certain how it would best look (and tobefrank, those results are not displaying properly).

    The code follows, and is also attached in it's entirety, with the Form_run being on page 23.

    Thanks in advance for your help.

    Private Sub Form_Load()
    On Error GoTo Err_Form_Load
    Dim strSQL As String, strSQL2 As String, strVariable As String

    'Call MkTblQryTrans

    strSQL = "SELECT ArnaudvilletoBayouSale330, BayouvilleToNapoleonvilleStation, GulfportToFlorenville300, " _
    & "GulfportToMobile300, Longview391, Luling291, MarchandJctToStRose270, MarchandJctToScottlandville270, " _
    & "MarksvilleToArnaudville330, MontpelierToMcComb130, OllaToMarksville330, OllaToWestMonroe330, " _
    & "OuachitaRiverToSterlington129, StRoseToFlorenville300, SugarBowlToMontpelierMainLine, [SugarBowlToMP85-130Loop], " _
    & "TerreboneJctToLuling300, WhistlerJctToBigCreek311, WhistlerToHurricane308 " _
    & "FROM qryOpenQryTrans_Pipe "

    strSQL2 = "SELECT Feature, WheelCountFT, WheelCountIN, StationNumberFT, DepthPERCENT, WTIN, LengthFT, LengthIN, " _
    & "InteriorExterior, OrientationCLOCKWISE, BurstModB31G, RPRModB31G, BurstEffArea, RPREffArea, SMYS, DistFromUSWeldFT, " _
    & "DistFromUSWeldIN, DistFromDSWeldFT, DistFromDSWeldIN, DistToUSAGMIN, DistToUSAGMIN, DistToDSAGMFT, " _
    & "DistToDSAGMIN, JointLengthFT, JointLengthIN, Comments, Latitude, Longitude, Elevation, AdditionalComments " _
    & "FROM qryOpenQryTrans_Report "

    Me.txtSQL.Value = strSQL
    Me.frmSubQryTrans.Form.RecordSource = strSQL

    'Me.txtSQL2.Value = strSQL2
    'Me.frmSubQryTrans.Form.RecordSource = strSQL2

    strVariable = "SELECT DISTINCTROW tblQryVariable_Other.Variable FROM tblQryVariable_Other;"
    Me.cboVariable1.RowSourceType = "Table/Query"
    Me.cboVariable1.RowSource = strVariable
    Me.cboVariable2.RowSourceType = "Table/Query"
    Me.cboVariable2.RowSource = strVariable
    Me.cboVariable3.RowSourceType = "Table/Query"
    Me.cboVariable3.RowSource = strVariable
    Me.cboVariable4.RowSourceType = "Table/Query"
    Me.cboVariable4.RowSource = strVariable
    Me.cboVariable5.RowSourceType = "Table/Query"
    Me.cboVariable5.RowSource = strVariable

    Exit_Form_Load:
    Exit Sub

    Err_Form_Load:
    MsgBox Err.Description
    Resume Exit_Form_Load

    End Sub
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2003
    Posts
    15
    To clarify in more specific terms, I have the following problem passing information to the query from which this subform is read:

    There is a subform window located in the main form (GISTestReporting), which is tied to frmSubOpenQryTrans. A user, through the use of combo boxes, selects a table, then a specific field from that table through which to parse through variables (=, >, <, etc.), and finally an infinite keyword search (text box).

    An example is PipelineOne (combo box one) has a feature ReportingType (combo box two) that may equal (variable "=") three ("3" placed in the text box as an infinite keyword). What sort of code would allow the programme to search the specific field noted in it's corresponding table for all incidents equal to 3, and then place the results in qryOpenQryTrans, displayed in the subform window frmSubOpenQryTrans? The code listed above is what I have to define this, but this information is not able to get past the "calculating" stage. Nothing is returned for some reason.

    If you can help me with this issue, that would constitute the greatest problem I have with this code, and I would be MOST GRATEFUL!!!!

    I hope this helps anyone who can help me....

  3. #3
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Lightbulb

    You have to post your whole code with forms etc. I may be able to fix it and can post it back to you. I think you are making things way too complicated.

Posting Permissions

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