Update Event

  • Thread starter ladybug via AccessMonster.com
  • Start date
L

ladybug via AccessMonster.com

I have a form called sfrm_status_of_lif2. In this form are two combo boxes,
status and sub_by. Third there is a text box, status_dt. Then there is a
command button called cmd_notes.

When this button is clicked another form opens up called
sfrm_status_of_lif_notes. The three boxes appear on this forms header and
the data entered from sfrm_status_of_lif2.

The problem is if I tab to the cmd_notes button after entering the status,
sub_by, and status_dt the info is not in form sfrm_status_of_lif_notes. If I
tab off of the form and then click on the cmd_notes button then the
selections are there. How can I get this to update once you click the button
before the form opens?
 
A

Al Campagna

ladybug,
Try a Refresh just before opening the second form.
The values you entered (status), has not been written to the table yet...
no update has occured yet.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
L

ladybug via AccessMonster.com

I apoligize, I do not know what you mean by try a refresh. How do I automate
this? Is that code?

Al said:
ladybug,
Try a Refresh just before opening the second form.
The values you entered (status), has not been written to the table yet...
no update has occured yet.
I have a form called sfrm_status_of_lif2. In this form are two combo
boxes,
[quoted text clipped - 12 lines]
button
before the form opens?
 
A

Al Campagna

ladybug,
Please don't <clip> relevant text from your previous post. Irrelevant
items are OK to clip, but not relevant items like field names, button names,
and form names... involved in your problem. Saves having to go to your
original post...

Are you opening the second form using a macro? I'll assume Macros...
which I never use... so I might be a bit rusty.

When in Macro design, select View/MacroNames from the Access upper menu
bar.
Give your macro a name like OpenLifNotes
Then add two actions to that macro...
MacroName Action
----------------------------
OpenLifNotes Requery
OpenForm

The Requery should update the values from the calling form to it's
associated table, so... when sfrm_status_of_lif_notes opens, the values (if
correctly called) will be there
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

ladybug via AccessMonster.com said:
I apoligize, I do not know what you mean by try a refresh. How do I
automate
this? Is that code?

Al said:
ladybug,
Try a Refresh just before opening the second form.
The values you entered (status), has not been written to the table
yet...
no update has occured yet.
I have a form called sfrm_status_of_lif2. In this form are two combo
boxes,
[quoted text clipped - 12 lines]
button
before the form opens?
 
L

ladybug via AccessMonster.com

I am not using a macro. This is what I have as an Event Procedure on the On
Click Event:
On Error GoTo Err_cmd_notes_Click

stDocName = "sfrm_status_of_lif_notes_edit"

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

Exit_cmd_notes_Click:
Exit Sub

Err_cmd_notes_Click:
MsgBox Err.Description
Resume Exit_cmd_notes_Click

Thank you for your help.

Al said:
ladybug,
Please don't <clip> relevant text from your previous post. Irrelevant
items are OK to clip, but not relevant items like field names, button names,
and form names... involved in your problem. Saves having to go to your
original post...

Are you opening the second form using a macro? I'll assume Macros...
which I never use... so I might be a bit rusty.

When in Macro design, select View/MacroNames from the Access upper menu
bar.
Give your macro a name like OpenLifNotes
Then add two actions to that macro...
MacroName Action
----------------------------
OpenLifNotes Requery
OpenForm

The Requery should update the values from the calling form to it's
associated table, so... when sfrm_status_of_lif_notes opens, the values (if
correctly called) will be there
I apoligize, I do not know what you mean by try a refresh. How do I
automate
[quoted text clipped - 10 lines]
 
A

Al Campagna

ladybug,
Much better....
I'll shorten the code for this example...
Private Sub cmdSomeButtonName_Click()
Refresh
DoCmd.OpenForm "sfrm_status_of_lif_notes_edit"
End sub

That will insure that the bound field values you entered on Form1
will be available to sfrm_status_of_lif_notes_edit
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

ladybug via AccessMonster.com said:
I am not using a macro. This is what I have as an Event Procedure on the
On
Click Event:
On Error GoTo Err_cmd_notes_Click

stDocName = "sfrm_status_of_lif_notes_edit"

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

Exit_cmd_notes_Click:
Exit Sub

Err_cmd_notes_Click:
MsgBox Err.Description
Resume Exit_cmd_notes_Click

Thank you for your help.

Al said:
ladybug,
Please don't <clip> relevant text from your previous post. Irrelevant
items are OK to clip, but not relevant items like field names, button
names,
and form names... involved in your problem. Saves having to go to your
original post...

Are you opening the second form using a macro? I'll assume Macros...
which I never use... so I might be a bit rusty.

When in Macro design, select View/MacroNames from the Access upper
menu
bar.
Give your macro a name like OpenLifNotes
Then add two actions to that macro...
MacroName Action
----------------------------
OpenLifNotes Requery
OpenForm

The Requery should update the values from the calling form to it's
associated table, so... when sfrm_status_of_lif_notes opens, the values
(if
correctly called) will be there
I apoligize, I do not know what you mean by try a refresh. How do I
automate
[quoted text clipped - 10 lines]
button
before the form opens?
 
L

ladybug via AccessMonster.com

Perfect. Thank you! That simple piece will help me in some of my other
forms as well!

Al said:
ladybug,
Much better....
I'll shorten the code for this example...
Private Sub cmdSomeButtonName_Click()
Refresh
DoCmd.OpenForm "sfrm_status_of_lif_notes_edit"
End sub

That will insure that the bound field values you entered on Form1
will be available to sfrm_status_of_lif_notes_edit
I am not using a macro. This is what I have as an Event Procedure on the
On
[quoted text clipped - 44 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

Allow additions 6
Visible by code 8
Testing for required data entry in form fields. 6
Cancel button in a form 5
Save Button Code 7
main form and popup 1
On Click Function Open Different Forms 9
recordset clone 1

Top