Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OpenForm (Access 2k)

    I'm at my witts end....please someone help me.....

    My table hold precert information and case mgmt information. I have txtSSN and txtMaxMC.

    I have 2 qry's working off this table.

    1 qry for Precert and the other for CM.

    I have 2 forms...1 for Precert and 1 for CM.

    After I complete Precert, I want to open frmCM to the SSN and MaxMC.

    I don't want a new record...I just want the record that holds the SSN and MaxMC. However, I continue to get a NEW record, no matter how many times or ways I've changed the code to open frmCM.

    The data for both are in the same table. Should be so simple...but for me it's not.

    Could someone please show me the error of my ways?

    Thanks in advance.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OpenForm (Access 2k)

    Has the DataEntry property of frmCM been set to Yes? If so, it'll always opened to a new record.

    If not, please post the code you use to open frmCM.

  3. #3
    Star Lounger
    Join Date
    Nov 2005
    Location
    Edmonton, Alberta, Canada
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OpenForm (Access 2k)

    If you mean you ONLY get a new record (i.e. no existing record), then, as HansV suggested, the Data Entry property in the form might be on. If you meant that you get the record you want AND a new record, turn off Allow Additions.

  4. #4
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OpenForm (Access 2k)

    Ok...I've turned off the Date Entry property...and that at least stops the NEW RECORD issue....but now when -- On the precert form txtSSN=12345 but the frmCM will open to another SSN.

    Here is a snippet of my code:
    <pre>Private Sub cboReviewType_AfterUpdate()
    'Update the subform and take user to appropriate forms
    Dim Msg, Style, Response As String
    Dim strEpisode As String
    Dim strInput As String, strMC As String
    Dim RS As DAO.Recordset
    Dim ctlMaxMCNo As Control

    Dim strCM As String
    Dim strHH As String
    Dim strIN As String

    Dim stLinkCriteria As String

    strCM = "frmCaseMgmt"
    strHH = "frmHomeHealth"
    strIN = "frmInpatient"

    Set ctlMaxMCNo = Forms!frmPrecert!txtMaxMCNo

    Select Case Me.cboReviewType
    Case 1
    Msg = "Inpatient xFer?" ' Define message.
    Style = vbYesNo ' Define buttons.
    Response = MsgBox(Msg, Style)
    If Response = vbYes Then ' User chose Yes.
    strInput = InputBox("maxMC #?")
    Me.txtMaxMCNo = strInput
    ctlMaxMCNo.Requery
    Me.txtReveiwType = "Case Mgmt."
    DoCmd.Save acForm, "frmPrecert"
    stLinkCriteria = "[MaxMCNo]=" & "'" & Me![txtMaxMCNo] & "'"
    DoCmd.OpenForm strCM, , , stLinkCriteria
    'DoCmd.OpenForm "frmCaseMgmt", acNormal, "", "", acEdit, acNormal
    Forms![frmCaseMgmt]!lblComments.Caption = "Initial Comments"
    Forms![frmCaseMgmt]!memIniComment.Visible = True

    Else ' User chose No.
    Me.txtMaxMCNo = "Pending"
    ctlMaxMCNo.Requery
    DoCmd.Save acForm, "frmPrecert"
    stLinkCriteria = "[MaxMCNo]=" & "'" & Me![txtMaxMCNo] & "'"
    DoCmd.OpenForm strCM, , , stLinkCriteria
    'DoCmd.OpenForm "frmCaseMgmt", acNormal, "", "", acEdit, acNormal
    Forms![frmCaseMgmt]!lblComments.Caption = "Initial Comments"
    Forms![frmCaseMgmt]!memIniComment.Visible = True</pre>


    Perhaps someone can make sense of this mess....I'm so confused I can't count to 3 right now.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OpenForm (Access 2k)

    You don't include the SSN in the WhereCondition. It should probably be something like
    <code>
    stLinkCriteria = "[MaxMCNo]='" & Me![txtMaxMCNo] & "' And [SSN]='" & Me![txtSSN] & "'"
    </code>
    Replace SSN with the actual field name.

Posting Permissions

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