Problem with Opening Form for Additional Data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Okay. I'll do my best to explain.

I have a main form where if someone chooses "03" for a field RESLT, it
automatically opens a form frmServedInfo for the user to complete additional
information. Below is the code to open the form and this works.

Dim stInfoForm As String
Dim stLinkCriteria As String

stInfoForm = "frmServedInfo"
stLinkCriteria = "([SUMMONS].[SERVNO])=" & Me![SERVNO]

If Me!RESLT = "03" Then

DoCmd.OpenForm stInfoForm, , , stLinkCriteria

End If


HOWEVER, once the form is open and the user completes the form, I keep
getting a Write Conflict Error. And eventually ends in Unrecognized
Database.
 
Worked perfectly!!! Another question though. Right after I posted this I
tried DoCmd.Save before opening the other form. How does this differ,
because it didn't work.

Alex Dybenko said:
Hi,
try to save record before you open another form:

me.dirty=false

DoCmd.OpenForm ...

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Sash said:
Okay. I'll do my best to explain.

I have a main form where if someone chooses "03" for a field RESLT, it
automatically opens a form frmServedInfo for the user to complete
additional
information. Below is the code to open the form and this works.

Dim stInfoForm As String
Dim stLinkCriteria As String

stInfoForm = "frmServedInfo"
stLinkCriteria = "([SUMMONS].[SERVNO])=" & Me![SERVNO]

If Me!RESLT = "03" Then

DoCmd.OpenForm stInfoForm, , , stLinkCriteria

End If


HOWEVER, once the form is open and the user completes the form, I keep
getting a Write Conflict Error. And eventually ends in Unrecognized
Database.
 
DoCmd.Save is going to save changes to the structure of the current
object (form in this case). It doesn't save changes to the data
attached to the form.



'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================

Worked perfectly!!! Another question though. Right after I posted this I
tried DoCmd.Save before opening the other form. How does this differ,
because it didn't work.

Alex Dybenko said:
Hi,
try to save record before you open another form:

me.dirty=false

DoCmd.OpenForm ...

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


Sash said:
Okay. I'll do my best to explain.

I have a main form where if someone chooses "03" for a field RESLT, it
automatically opens a form frmServedInfo for the user to complete
additional
information. Below is the code to open the form and this works.

Dim stInfoForm As String
Dim stLinkCriteria As String

stInfoForm = "frmServedInfo"
stLinkCriteria = "([SUMMONS].[SERVNO])=" & Me![SERVNO]

If Me!RESLT = "03" Then

DoCmd.OpenForm stInfoForm, , , stLinkCriteria

End If


HOWEVER, once the form is open and the user completes the form, I keep
getting a Write Conflict Error. And eventually ends in Unrecognized
Database.
 
Back
Top