Thech701storm
Programmer
I have a form (FORM1) with a listbox keyfield to question another table. WHen the user enters the keyfield data and clicks on the search button I open another form (FORM2)and display the data related to that keyfield. The problem happens when I close FORM2. I receive a message 'Cannot insert record - entry already exists'. The FORM2 is opened as READONLY but ACCESS seams to try to update the FORM2 underlying table. I just want to BROWSE the data from FORM2.
Essentially, FORM2 is the form to enter data in it's associated table but I want to reuse it to browse but it's not working !!!
HELP !!! I tried this and didn't work
Private Sub EnrgRechercheTravail_Click()
On Error GoTo Err_EnrgRechercheTravail_Click
DoCmd.OpenForm "Fo Travail", acNormal, , ,AcFormReadOnly
Forms![fo travail].Caption = "Rechercher un TRAVAIL "
Forms![fo travail].Section(2).Visible = False
Forms![fo travail].[TravailNom] = [Lot en problème]
Forms![fo travail].AllowEdits = False
Forms![fo travail].AllowEditing = False
Forms![fo travail].[TravailNom].Locked = True
Forms![fo travail].[Fermeture].Visible = False
Forms![fo travail].[BoîteRetour].Visible = False
Exit_EnrgRechercheTravail_Click:
Exit Sub
Err_EnrgRechercheTravail_Click:
MsgBox Err.Description
Resume Exit_EnrgRechercheTravail_Click
End Sub
Essentially, FORM2 is the form to enter data in it's associated table but I want to reuse it to browse but it's not working !!!
HELP !!! I tried this and didn't work
Private Sub EnrgRechercheTravail_Click()
On Error GoTo Err_EnrgRechercheTravail_Click
DoCmd.OpenForm "Fo Travail", acNormal, , ,AcFormReadOnly
Forms![fo travail].Caption = "Rechercher un TRAVAIL "
Forms![fo travail].Section(2).Visible = False
Forms![fo travail].[TravailNom] = [Lot en problème]
Forms![fo travail].AllowEdits = False
Forms![fo travail].AllowEditing = False
Forms![fo travail].[TravailNom].Locked = True
Forms![fo travail].[Fermeture].Visible = False
Forms![fo travail].[BoîteRetour].Visible = False
Exit_EnrgRechercheTravail_Click:
Exit Sub
Err_EnrgRechercheTravail_Click:
MsgBox Err.Description
Resume Exit_EnrgRechercheTravail_Click
End Sub