CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Please Help!

  1. #1
    Join Date
    Feb 2000
    Posts
    1

    Please Help!

    I have the following symptoms: When my form is invoked from another, everything starts to come up, then when the second record source is set, everything goes BLANK with the form outline still there. Without the second recordsource being set, form works fine. I was told that you can reset the recordsource more than once...is this not true? Here's the exact code:

    DoCmd.OpenForm "PreHearings", acNormal, , , acFormAdd, acHidden
    mysql = "SELECT * FROM REC"
    Forms("PreHearings").RecordSource = mysql
    Forms("PreHearings").Controls("HearingTypeLabel").Caption = myhearingtype
    Forms("PreHearings").Controls("Trigger").Caption = "2"
    Forms("PreHearings").Controls("Action").Caption = "Add"
    Forms("PreHearings").Caption = "new " & myhearingtypeName
    Forms("PreHearings").Controls("HearingTypeLabel").Caption = myhearingtype
    Forms("PreHearings").SetFocus
    SetPreHearingPages myhearingtype

    mysql = "SELECT BRC.EID, BRC.ClmtID, BRC.CarTpaID, BRC.Injury_Date as DIO, BRC.Clm_Num, BRC.CommNum, BRC.LoginIDAtty, Now() as REC_Date, BRC.FldrCod as CodeKey, BRC.FldrCod as Alt_TWCC, BRC.FldrCod as Alt_InjuryDate, BRC.FldrCod as Rush_Deadline, BRC.CGID, BRC.CID, BRC.TPAId, BRC.TPACid, BRC.CarTPAId, BRC.CrtDate, BRC.ModDate, " & "BRC.FldrCod" & " as Description," & "Address_Other.NameFirst as CLMTNameFirst, Address_Other.NameMI as CLMTNameMI, Address_Other.NameLast as CLMTNameLast, Address_Other.SSN as CLMTSSN FROM " & "BRC" & " LEFT JOIN " & "Address_Other" & " on " & "BRC.ClmtID =" & "Address_Other.ADD_OTHERID" & " WHERE " & "BRC" & "." & "Clmt" & "Id =" & Forms!Hearings.CLMTID

    Forms("PreHearings").RecordSource = mysql





  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Please Help!

    Is it VB or VBA?!

    i guess Now() as REC_Date could be doing something funny in a sql.

    May be the last condition:
    "Id =" & Forms!Hearings.CLMTID should go as
    "Id ='" & Forms!Hearings.CLMTID & "'" ??

    Secondly, you dont have to refer Forms("..") so many times. ( i hope this works in VBA also!)

    dim pFrm as Form
    set pFrm = Forms("PreHearing")
    it would reduce the no. of references and make it faster.

    RK

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

Featured