Saving records

G

Guest

This is probably a very easy problem but I have been pulling my hair out
attempting to figure out where I am going wrong. Perhaps someone here will
be able to tell me what I am doing wrong.

I have a form that I use to enter & view captial/non capital assets. On
this form there is a button that opens another form for the user to enter
comments related to the equipment currently displayed. I have the button set
for "on click" to do the following:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmComments"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

When the form comments opens, I have the "on load" set to do the following:

If ParentFormIsOpen() Then Forms![tblassets]!ToggleLink = True
Me.chrComments.SetFocus

Basically, when I open the comment form from my asset form, it links the
serial number from the asset form to comments. This allows the user to
attach the comments without having to retype the serial number. My problem
is, that when the user exits the comments form, the comment is not saved. No
matter what I try I cannot get it to save the record. I am certain this
probably an easy fix and I am simply over looking it.

Any and all help would be greatly appreciated!
 
A

Allen Browne

What is the connection between the 2 form's tables?
a) The Comment field a memo in the same table, or
b) The Comment field is in a related table, so there can be many comments
for one record.

If (a), you can solve the problem by putting a very narrow text box for
Comment on your original form. Make it 0.01" wide if you like so the user
can't even see it. The set the button's click event procedure to:
Me.Comment.SetFocus
RunCommand acCmdZoomBox

If (b), the approach you have should work to open the form. I didn't
understand what its Form_Load was meant to achieve. Perhaps you needed
something like this:
Me![SerialNumber] = Forms![tblassets]![SerialNumber]
 
G

Guest

It's (b) the comment field is in a related table, so there can be many
comments for one record. Everything works EXCEPT when you enter a new
comment and close the form, the comment is not saved. I will try your
suggestion and see where that gets me. Thanks!

Allen Browne said:
What is the connection between the 2 form's tables?
a) The Comment field a memo in the same table, or
b) The Comment field is in a related table, so there can be many comments
for one record.

If (a), you can solve the problem by putting a very narrow text box for
Comment on your original form. Make it 0.01" wide if you like so the user
can't even see it. The set the button's click event procedure to:
Me.Comment.SetFocus
RunCommand acCmdZoomBox

If (b), the approach you have should work to open the form. I didn't
understand what its Form_Load was meant to achieve. Perhaps you needed
something like this:
Me![SerialNumber] = Forms![tblassets]![SerialNumber]

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Amy said:
This is probably a very easy problem but I have been pulling my hair out
attempting to figure out where I am going wrong. Perhaps someone here
will
be able to tell me what I am doing wrong.

I have a form that I use to enter & view captial/non capital assets. On
this form there is a button that opens another form for the user to enter
comments related to the equipment currently displayed. I have the button
set
for "on click" to do the following:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmComments"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

When the form comments opens, I have the "on load" set to do the
following:

If ParentFormIsOpen() Then Forms![tblassets]!ToggleLink = True
Me.chrComments.SetFocus

Basically, when I open the comment form from my asset form, it links the
serial number from the asset form to comments. This allows the user to
attach the comments without having to retype the serial number. My
problem
is, that when the user exits the comments form, the comment is not saved.
No
matter what I try I cannot get it to save the record. I am certain this
probably an easy fix and I am simply over looking it.

Any and all help would be greatly appreciated!
 
G

Guest

It's b) comment field in related table (comments), so there can be many for
one.
I tried your suggestion - changed the onload to:

Me.chrComments.SetFocus
and that works just fine - except it still will not save the new comment.
ARGH!! :)

Amy

Allen Browne said:
What is the connection between the 2 form's tables?
a) The Comment field a memo in the same table, or
b) The Comment field is in a related table, so there can be many comments
for one record.

If (a), you can solve the problem by putting a very narrow text box for
Comment on your original form. Make it 0.01" wide if you like so the user
can't even see it. The set the button's click event procedure to:
Me.Comment.SetFocus
RunCommand acCmdZoomBox

If (b), the approach you have should work to open the form. I didn't
understand what its Form_Load was meant to achieve. Perhaps you needed
something like this:
Me![SerialNumber] = Forms![tblassets]![SerialNumber]

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Amy said:
This is probably a very easy problem but I have been pulling my hair out
attempting to figure out where I am going wrong. Perhaps someone here
will
be able to tell me what I am doing wrong.

I have a form that I use to enter & view captial/non capital assets. On
this form there is a button that opens another form for the user to enter
comments related to the equipment currently displayed. I have the button
set
for "on click" to do the following:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmComments"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

When the form comments opens, I have the "on load" set to do the
following:

If ParentFormIsOpen() Then Forms![tblassets]!ToggleLink = True
Me.chrComments.SetFocus

Basically, when I open the comment form from my asset form, it links the
serial number from the asset form to comments. This allows the user to
attach the comments without having to retype the serial number. My
problem
is, that when the user exits the comments form, the comment is not saved.
No
matter what I try I cannot get it to save the record. I am certain this
probably an easy fix and I am simply over looking it.

Any and all help would be greatly appreciated!
 
A

Allen Browne

Does it give an error message?

What happens if you explicitly save the record by choosing Save Record on
the Records menu?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Amy said:
It's b) comment field in related table (comments), so there can be many
for
one.
I tried your suggestion - changed the onload to:

Me.chrComments.SetFocus
and that works just fine - except it still will not save the new comment.
ARGH!! :)

Amy

Allen Browne said:
What is the connection between the 2 form's tables?
a) The Comment field a memo in the same table, or
b) The Comment field is in a related table, so there can be many comments
for one record.

If (a), you can solve the problem by putting a very narrow text box for
Comment on your original form. Make it 0.01" wide if you like so the user
can't even see it. The set the button's click event procedure to:
Me.Comment.SetFocus
RunCommand acCmdZoomBox

If (b), the approach you have should work to open the form. I didn't
understand what its Form_Load was meant to achieve. Perhaps you needed
something like this:
Me![SerialNumber] = Forms![tblassets]![SerialNumber]

Amy said:
This is probably a very easy problem but I have been pulling my hair
out
attempting to figure out where I am going wrong. Perhaps someone here
will
be able to tell me what I am doing wrong.

I have a form that I use to enter & view captial/non capital assets.
On
this form there is a button that opens another form for the user to
enter
comments related to the equipment currently displayed. I have the
button
set
for "on click" to do the following:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmComments"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

When the form comments opens, I have the "on load" set to do the
following:

If ParentFormIsOpen() Then Forms![tblassets]!ToggleLink = True
Me.chrComments.SetFocus

Basically, when I open the comment form from my asset form, it links
the
serial number from the asset form to comments. This allows the user to
attach the comments without having to retype the serial number. My
problem
is, that when the user exits the comments form, the comment is not
saved.
No
matter what I try I cannot get it to save the record. I am certain
this
probably an easy fix and I am simply over looking it.

Any and all help would be greatly appreciated!
 
G

Guest

This also does not save the record. Sigh....

Allen Browne said:
Does it give an error message?

What happens if you explicitly save the record by choosing Save Record on
the Records menu?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Amy said:
It's b) comment field in related table (comments), so there can be many
for
one.
I tried your suggestion - changed the onload to:

Me.chrComments.SetFocus
and that works just fine - except it still will not save the new comment.
ARGH!! :)

Amy

Allen Browne said:
What is the connection between the 2 form's tables?
a) The Comment field a memo in the same table, or
b) The Comment field is in a related table, so there can be many comments
for one record.

If (a), you can solve the problem by putting a very narrow text box for
Comment on your original form. Make it 0.01" wide if you like so the user
can't even see it. The set the button's click event procedure to:
Me.Comment.SetFocus
RunCommand acCmdZoomBox

If (b), the approach you have should work to open the form. I didn't
understand what its Form_Load was meant to achieve. Perhaps you needed
something like this:
Me![SerialNumber] = Forms![tblassets]![SerialNumber]

This is probably a very easy problem but I have been pulling my hair
out
attempting to figure out where I am going wrong. Perhaps someone here
will
be able to tell me what I am doing wrong.

I have a form that I use to enter & view captial/non capital assets.
On
this form there is a button that opens another form for the user to
enter
comments related to the equipment currently displayed. I have the
button
set
for "on click" to do the following:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmComments"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

When the form comments opens, I have the "on load" set to do the
following:

If ParentFormIsOpen() Then Forms![tblassets]!ToggleLink = True
Me.chrComments.SetFocus

Basically, when I open the comment form from my asset form, it links
the
serial number from the asset form to comments. This allows the user to
attach the comments without having to retype the serial number. My
problem
is, that when the user exits the comments form, the comment is not
saved.
No
matter what I try I cannot get it to save the record. I am certain
this
probably an easy fix and I am simply over looking it.

Any and all help would be greatly appreciated!
 
G

Guest

It does not give an error message - it also will not save the record even if
choosing the Save Record on the Records menu....

Allen Browne said:
Does it give an error message?

What happens if you explicitly save the record by choosing Save Record on
the Records menu?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Amy said:
It's b) comment field in related table (comments), so there can be many
for
one.
I tried your suggestion - changed the onload to:

Me.chrComments.SetFocus
and that works just fine - except it still will not save the new comment.
ARGH!! :)

Amy

Allen Browne said:
What is the connection between the 2 form's tables?
a) The Comment field a memo in the same table, or
b) The Comment field is in a related table, so there can be many comments
for one record.

If (a), you can solve the problem by putting a very narrow text box for
Comment on your original form. Make it 0.01" wide if you like so the user
can't even see it. The set the button's click event procedure to:
Me.Comment.SetFocus
RunCommand acCmdZoomBox

If (b), the approach you have should work to open the form. I didn't
understand what its Form_Load was meant to achieve. Perhaps you needed
something like this:
Me![SerialNumber] = Forms![tblassets]![SerialNumber]

This is probably a very easy problem but I have been pulling my hair
out
attempting to figure out where I am going wrong. Perhaps someone here
will
be able to tell me what I am doing wrong.

I have a form that I use to enter & view captial/non capital assets.
On
this form there is a button that opens another form for the user to
enter
comments related to the equipment currently displayed. I have the
button
set
for "on click" to do the following:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmComments"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

When the form comments opens, I have the "on load" set to do the
following:

If ParentFormIsOpen() Then Forms![tblassets]!ToggleLink = True
Me.chrComments.SetFocus

Basically, when I open the comment form from my asset form, it links
the
serial number from the asset form to comments. This allows the user to
attach the comments without having to retype the serial number. My
problem
is, that when the user exits the comments form, the comment is not
saved.
No
matter what I try I cannot get it to save the record. I am certain
this
probably an easy fix and I am simply over looking it.

Any and all help would be greatly appreciated!
 
A

Allen Browne

If there is no message, I can't help further.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Amy said:
It does not give an error message - it also will not save the record even
if
choosing the Save Record on the Records menu....

Allen Browne said:
Does it give an error message?

What happens if you explicitly save the record by choosing Save Record on
the Records menu?

Amy said:
It's b) comment field in related table (comments), so there can be many
for
one.
I tried your suggestion - changed the onload to:

Me.chrComments.SetFocus
and that works just fine - except it still will not save the new
comment.
ARGH!! :)

Amy

:

What is the connection between the 2 form's tables?
a) The Comment field a memo in the same table, or
b) The Comment field is in a related table, so there can be many
comments
for one record.

If (a), you can solve the problem by putting a very narrow text box
for
Comment on your original form. Make it 0.01" wide if you like so the
user
can't even see it. The set the button's click event procedure to:
Me.Comment.SetFocus
RunCommand acCmdZoomBox

If (b), the approach you have should work to open the form. I didn't
understand what its Form_Load was meant to achieve. Perhaps you needed
something like this:
Me![SerialNumber] = Forms![tblassets]![SerialNumber]

This is probably a very easy problem but I have been pulling my hair
out
attempting to figure out where I am going wrong. Perhaps someone
here
will
be able to tell me what I am doing wrong.

I have a form that I use to enter & view captial/non capital assets.
On
this form there is a button that opens another form for the user to
enter
comments related to the equipment currently displayed. I have the
button
set
for "on click" to do the following:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmComments"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

When the form comments opens, I have the "on load" set to do the
following:

If ParentFormIsOpen() Then Forms![tblassets]!ToggleLink = True
Me.chrComments.SetFocus

Basically, when I open the comment form from my asset form, it links
the
serial number from the asset form to comments. This allows the user
to
attach the comments without having to retype the serial number. My
problem
is, that when the user exits the comments form, the comment is not
saved.
No
matter what I try I cannot get it to save the record. I am certain
this
probably an easy fix and I am simply over looking it.

Any and all help would be greatly appreciated!
 
G

Guest

Thanks.... I will have to find another way I guess.... I was hoping it was
something simple I was overlooking. I appreciate your time though.

Amy

Allen Browne said:
If there is no message, I can't help further.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Amy said:
It does not give an error message - it also will not save the record even
if
choosing the Save Record on the Records menu....

Allen Browne said:
Does it give an error message?

What happens if you explicitly save the record by choosing Save Record on
the Records menu?

It's b) comment field in related table (comments), so there can be many
for
one.
I tried your suggestion - changed the onload to:

Me.chrComments.SetFocus
and that works just fine - except it still will not save the new
comment.
ARGH!! :)

Amy

:

What is the connection between the 2 form's tables?
a) The Comment field a memo in the same table, or
b) The Comment field is in a related table, so there can be many
comments
for one record.

If (a), you can solve the problem by putting a very narrow text box
for
Comment on your original form. Make it 0.01" wide if you like so the
user
can't even see it. The set the button's click event procedure to:
Me.Comment.SetFocus
RunCommand acCmdZoomBox

If (b), the approach you have should work to open the form. I didn't
understand what its Form_Load was meant to achieve. Perhaps you needed
something like this:
Me![SerialNumber] = Forms![tblassets]![SerialNumber]

This is probably a very easy problem but I have been pulling my hair
out
attempting to figure out where I am going wrong. Perhaps someone
here
will
be able to tell me what I am doing wrong.

I have a form that I use to enter & view captial/non capital assets.
On
this form there is a button that opens another form for the user to
enter
comments related to the equipment currently displayed. I have the
button
set
for "on click" to do the following:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmComments"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

When the form comments opens, I have the "on load" set to do the
following:

If ParentFormIsOpen() Then Forms![tblassets]!ToggleLink = True
Me.chrComments.SetFocus

Basically, when I open the comment form from my asset form, it links
the
serial number from the asset form to comments. This allows the user
to
attach the comments without having to retype the serial number. My
problem
is, that when the user exits the comments form, the comment is not
saved.
No
matter what I try I cannot get it to save the record. I am certain
this
probably an easy fix and I am simply over looking it.

Any and all help would be greatly appreciated!
 

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