Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

double click error.

Status
Not open for further replies.

aaabuhalime

Instructor
Nov 22, 2012
67
US
Hi every one ,
I have created two forms , form1 and form 2, form 1 consist of two fields to enter FName, and LName, and ok button, the ok button when clicked open the form2, form two consist of alist of records, and two button one to add contact and an other button to stop/cancel, the code I am using is listed below, the problem I am facing now is when I first open from 2, every thing works perfectly I can double click on any record an it opens just fine,then when I close the record that just browsed I can not open it again, or when I try to double click on any other record it doest do any thing , I have to close the whole thing and then reopen the form then I can double click on any othe record, and non of the button works as well, can any one help please, what I want is to able to do is be able to click on any rerod browse it and then click on the other record without the need to close the form and reopn it to be able to look at the other record, I also notice an error message says"Cant save record at this time", I hope it is clear. Many thanks in Advance.
Code:
Private Sub cmdContinue_Click()

          DoCmd.Close

    
End Sub

Private Sub cmdStop_Click()

    Me.Visible = False
 Me.Visible = False
End Sub
     


Private Sub Form_Load()

    Dim strSQL As String
    
    Page10.SetFocus
    
    strSQL = "select ContactID,LName, FName, City  from qryContacts where LName like ""*" & Forms!form1!txtLName & "*"" and FName like ""*" & Forms!form1!txtFName & "*"""
    List13.RowSource = strSQL
    
    If List13.ListCount > 0 Then
        Page11.SetFocus
    Else
        DoCmd.Close
    End If
    
End Sub

Private Sub List13_DblClick(Cancel As Integer)
On Error GoTo Err_Command9_Click
DoCmd.OpenForm "frmContacts", acNormal, , "ContactID=" & List13, , acDialog

    Exit Sub


    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "frmContacts"
    
    stLinkCriteria = "[StringContactID]=" & "'" & Me![List13] & "'"
    
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    
DoCmd.Close acForm, "frmContacts"

Exit_Command9_Click:
    Exit Sub

Err_Command9_Click:
    MsgBox Err.Description
    Resume Exit_Command9_Click
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top