Open Args trouble saving

G

Guest

Please help!

Employee form (data source is employee qry for active employees) has button
to call Note form (data source is table).

Code behind button OnClick:
Dim NewData, stDocName, stLinkCriteria
NewData = Me!CGID
stDocName = "frm3DE NoteAlert"
stLinkCriteria = "[CGID]=" & "'" & Me![CGID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd, acDialog, NewData

Code behind Load Event on called note form:
If Not IsNull(Me.OpenArgs) Then
Me!CGID = Me.OpenArgs
DoCmd.Save
End If

The called form is Yes to add/edit/delete and data entry.
OpenArgs passes the CGID to the called form successfully; the control's
source is the CGID in the table.

I am unable to save the record and cannot see why not. Can someone please
tell me what I am unable to see?
 
G

Guest

Try and change the data entry to false, after all you are trying to edit an
existing record
 
G

Guest

NO! I'm not trying to edit a record. I am attempting to create a new one in
the note table.

Anything to help that?
--
Thanks for your help,
Chris


Ofer said:
Try and change the data entry to false, after all you are trying to edit an
existing record
--
I hope that helped
Good luck


Chris said:
Please help!

Employee form (data source is employee qry for active employees) has button
to call Note form (data source is table).

Code behind button OnClick:
Dim NewData, stDocName, stLinkCriteria
NewData = Me!CGID
stDocName = "frm3DE NoteAlert"
stLinkCriteria = "[CGID]=" & "'" & Me![CGID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd, acDialog, NewData

Code behind Load Event on called note form:
If Not IsNull(Me.OpenArgs) Then
Me!CGID = Me.OpenArgs
DoCmd.Save
End If

The called form is Yes to add/edit/delete and data entry.
OpenArgs passes the CGID to the called form successfully; the control's
source is the CGID in the table.

I am unable to save the record and cannot see why not. Can someone please
tell me what I am unable to see?
 
G

Guest

In that case there is no need to the stLinkCriteria
Does the form bound to the table, record source?
Does the field bound the the field in the table, control source?
Do you get any error message?
Try and open the form seperatly, and enter data.

--
I hope that helped
Good luck


Chris said:
NO! I'm not trying to edit a record. I am attempting to create a new one in
the note table.

Anything to help that?
--
Thanks for your help,
Chris


Ofer said:
Try and change the data entry to false, after all you are trying to edit an
existing record
--
I hope that helped
Good luck


Chris said:
Please help!

Employee form (data source is employee qry for active employees) has button
to call Note form (data source is table).

Code behind button OnClick:
Dim NewData, stDocName, stLinkCriteria
NewData = Me!CGID
stDocName = "frm3DE NoteAlert"
stLinkCriteria = "[CGID]=" & "'" & Me![CGID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd, acDialog, NewData

Code behind Load Event on called note form:
If Not IsNull(Me.OpenArgs) Then
Me!CGID = Me.OpenArgs
DoCmd.Save
End If

The called form is Yes to add/edit/delete and data entry.
OpenArgs passes the CGID to the called form successfully; the control's
source is the CGID in the table.

I am unable to save the record and cannot see why not. Can someone please
tell me what I am unable to see?
 
D

Dirk Goldgar

Chris said:
Please help!

Employee form (data source is employee qry for active employees) has
button to call Note form (data source is table).

Code behind button OnClick:
Dim NewData, stDocName, stLinkCriteria
NewData = Me!CGID
stDocName = "frm3DE NoteAlert"
stLinkCriteria = "[CGID]=" & "'" & Me![CGID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd, acDialog,
NewData

Code behind Load Event on called note form:
If Not IsNull(Me.OpenArgs) Then
Me!CGID = Me.OpenArgs
DoCmd.Save
End If

The called form is Yes to add/edit/delete and data entry.
OpenArgs passes the CGID to the called form successfully; the
control's source is the CGID in the table.

I am unable to save the record and cannot see why not. Can someone
please tell me what I am unable to see?

What error message are you getting? If the Notes record is supposed to
be related to the current form, maybe the current form's record hasn't
been saved yet. If that's the case, have your command button command
save the record before opening the [frm3DE NoteAlert] form:

If Me.Dirty Then Me.Dirty = False
 
G

Guest

I had just discovered that saving was my issue. I forgot how...dirty. Thanks
so much,Dirk
--
Thanks for your help,
Chris


Dirk Goldgar said:
Chris said:
Please help!

Employee form (data source is employee qry for active employees) has
button to call Note form (data source is table).

Code behind button OnClick:
Dim NewData, stDocName, stLinkCriteria
NewData = Me!CGID
stDocName = "frm3DE NoteAlert"
stLinkCriteria = "[CGID]=" & "'" & Me![CGID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd, acDialog,
NewData

Code behind Load Event on called note form:
If Not IsNull(Me.OpenArgs) Then
Me!CGID = Me.OpenArgs
DoCmd.Save
End If

The called form is Yes to add/edit/delete and data entry.
OpenArgs passes the CGID to the called form successfully; the
control's source is the CGID in the table.

I am unable to save the record and cannot see why not. Can someone
please tell me what I am unable to see?

What error message are you getting? If the Notes record is supposed to
be related to the current form, maybe the current form's record hasn't
been saved yet. If that's the case, have your command button command
save the record before opening the [frm3DE NoteAlert] form:

If Me.Dirty Then Me.Dirty = False

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top