Results 1 to 3 of 3

Thread: Organinizing App

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    153

    Post

    That what I would like to do, but I'm a Newbee. The above code is a part of a module(with corresponding form) that returns a value for 30 recordsets. I have several modules(8) for different forms. Everything is mainly at a Parent level. It's at the subname level where all the scenarios come into play because I need the names(30) to change in the SQL statement based on the criteria. Ex: "If combo1.text = "LFDIV_AN" THEN " the names in SQL statements would change. Complex?

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    153

    Post

    I've run into a situation where my App. requires different scenarios based on the results of a combo box. There could be 45 different scenarios based on the combo box text. This may cause the creation of 45 different sub or function, maybe a different modules(.bas) for each. Forms as well.

    Should I use resource files, the case statement, search and replace, etc.? A sample code is below. The names (AIGUS, ALICO, AIA) have about 10 -13 subnames that I may want the values for depending on the name in my combo box 1. The subnames will have suffixes suchas: AIGUS_AN, ALICO_AN AND AIA.AN.

    Any ideas on how to tackle this?

    ssql = "select * from Act where name = 'AIGUS'and account = '" & Trim(frmDataEnv.Combo3.Text) & "'"
    Set myrecordset1 = frmDataEnv.myconnection.Execute(ssql)
    ssql = "select * from Act where name = 'ALICO'and account = '" & Trim(frmDataEnv.Combo3.Text) & "'"
    Set myRecordset2 = frmDataEnv.myconnection.Execute(ssql)
    ssql = "select * from Act where name = 'AIA'and account = '" & Trim(frmDataEnv.Combo3.Text) & "'"
    Set myRecordset3 = frmDataEnv.myconnection.Execute(ssql)
    AddZeroValue myrecordset1, Premium.List2
    AddZeroValue myRecordset2, Premium.List3
    AddZeroValue myRecordset3, Premium.List4


  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Can't you write 1 function that takes the parameters in combo box 1 and returns the desired result?

Posting Permissions

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



Click Here to Expand Forum to Full Width