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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem getting out of form without editing Msg

Status
Not open for further replies.

Thech701storm

Programmer
Jun 12, 2003
7
CA
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

 
What control used for display data, listBox ?
 
On Form2 there are textboxes and hyperlinks entry fields.

Actually I reuse the Form2 which is already used to enter the data to the Form.table (normal use from mainMenu when in ENTER mode). I would like FORM2 to be opened as Browse only from FORM1 so when I quit it does not want to save the data that is being browsed.

Regards

Norm

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top