Have to Close Form to Populate

  • Thread starter zat via AccessMonster.com
  • Start date
Z

zat via AccessMonster.com

I have a form that allows users to input values and then select a "Breakdown"
button on the same form to input more values. These two forms are linked by
a SANum. I can put the data in the main form with no problem. I select the
breakdown button the SANum is not populated; I enter values and close the
breakdown form, reopen it and the values are gone. However, when I close the
entire form and reopen it, then click on the breakdown button the SANum field
is populated with the correct number and I can now enter the dollar values
that will stay. The users will not be real happy if I make them close the
form and reopen it each time. Any suggestions on what I'm doing wrong. The
Button is an OnClick Event Procedure with this code:

Private Sub Command81_Click()
On Error GoTo Err_Command81_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAwardFeeBreakdown"

stLinkCriteria = "[strSANum]=" & "'" & Me![strSANum] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command81_Click:
Exit Sub

Err_Command81_Click:
MsgBox Err.Description
Resume Exit_Command81_Click

End Sub
 
G

Guest

hi,

Looks like this is an issue with "SAVE". Access automatically saves data
related to a record, but if the focus is still on the record in question,
those changes will not be reflected. So maybe you should try something like
going to the next record when you hit the last field of the record being
edited, then back to the last record?

For example,

AfterUpdate of the last field:
Docmd.gotorecord,,acnewrecord
docmd.gotorecord,,aclast

A refresh button may also help instead of using the above.

Hope this helps!

geebee
 
Z

zat via AccessMonster.com

Wow thanks! That was such an easy fix; I just added a Save button. Will
just have to train the users to hit Save first.
hi,

Looks like this is an issue with "SAVE". Access automatically saves data
related to a record, but if the focus is still on the record in question,
those changes will not be reflected. So maybe you should try something like
going to the next record when you hit the last field of the record being
edited, then back to the last record?

For example,

AfterUpdate of the last field:
Docmd.gotorecord,,acnewrecord
docmd.gotorecord,,aclast

A refresh button may also help instead of using the above.

Hope this helps!

geebee
I have a form that allows users to input values and then select a "Breakdown"
button on the same form to input more values. These two forms are linked by
[quoted text clipped - 26 lines]
 
G

Guest

NP. Just a thought here...
What if users forget to hit the SAVE button? You might wanted to consider
having it automatically save after certain fields are populated. Also, add a
couple records, and hit SAVE each time to make sure there are no duplicates
created by hitting the SAVE button.

geebee


zat via AccessMonster.com said:
Wow thanks! That was such an easy fix; I just added a Save button. Will
just have to train the users to hit Save first.
hi,

Looks like this is an issue with "SAVE". Access automatically saves data
related to a record, but if the focus is still on the record in question,
those changes will not be reflected. So maybe you should try something like
going to the next record when you hit the last field of the record being
edited, then back to the last record?

For example,

AfterUpdate of the last field:
Docmd.gotorecord,,acnewrecord
docmd.gotorecord,,aclast

A refresh button may also help instead of using the above.

Hope this helps!

geebee
I have a form that allows users to input values and then select a "Breakdown"
button on the same form to input more values. These two forms are linked by
[quoted text clipped - 26 lines]
 

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

Similar Threads


Top