By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,479 Members | 2,239 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,479 IT Pros & Developers. It's quick & easy.

Refreshing Data

P: n/a
I have a contact form that once the contact information is filled out,
a button is pressed by the user to pull up another form that schedules
a call back date and time for that record. If you hit that button on
a current record that already has a call back scheduled, it will show
that information for that contact already in the form. If nothing is
scheduled, the pull down box for that new record will be blank. Of
course, the new record will not show up in the pull down box unless I
hit the refresh button on the first form (contact) first before
hitting the call back button. So, if you're still with me, what I am
attempting to do is cause a refresh of the first form while invoking
the call back button (so the new contact will appear in the drop down
box without seperately hitting the refresh button), and/or if possible
when clicking on the call back button, having a new call back record
created, with the current (new) contact already selected in the
contact drop down box. Here is my current code for the button:

Private Sub Calls_Click()
On Error GoTo Err_Calls_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "CallsForm"

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

Exit_Calls_Click:
Exit Sub

Err_Calls_Click:
MsgBox Err.Description
Resume Exit_Calls_Click

End Sub

Aug 13 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
well, if i understand you correctly, the combo box you're concerned with is
on the second form, not the first form. sounds to me like you just need to
write the first form's record to disk before calling the second form. try
the following, as

Private Sub Calls_Click()
On Error GoTo Err_Calls_Click

Dim stDocName As String
Dim stLinkCriteria As String

If Me.Dirty Then Me.Dirty = False
stDocName = "CallsForm"
stLinkCriteria = "[Company]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Calls_Click:
Exit Sub

Err_Calls_Click:
MsgBox Err.Description
Resume Exit_Calls_Click

End Sub

hth
"magmike" <ma******@yahoo.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
I have a contact form that once the contact information is filled out,
a button is pressed by the user to pull up another form that schedules
a call back date and time for that record. If you hit that button on
a current record that already has a call back scheduled, it will show
that information for that contact already in the form. If nothing is
scheduled, the pull down box for that new record will be blank. Of
course, the new record will not show up in the pull down box unless I
hit the refresh button on the first form (contact) first before
hitting the call back button. So, if you're still with me, what I am
attempting to do is cause a refresh of the first form while invoking
the call back button (so the new contact will appear in the drop down
box without seperately hitting the refresh button), and/or if possible
when clicking on the call back button, having a new call back record
created, with the current (new) contact already selected in the
contact drop down box. Here is my current code for the button:

Private Sub Calls_Click()
On Error GoTo Err_Calls_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "CallsForm"

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

Exit_Calls_Click:
Exit Sub

Err_Calls_Click:
MsgBox Err.Description
Resume Exit_Calls_Click

End Sub

Aug 14 '07 #2

P: n/a
magmike <ma******@yahoo.comwrote in
news:11**********************@g4g2000hsf.googlegro ups.com:
I have a contact form that once the contact information is
filled out, a button is pressed by the user to pull up another
form that schedules a call back date and time for that record.
If you hit that button on a current record that already has a
call back scheduled, it will show that information for that
contact already in the form. If nothing is scheduled, the pull
down box for that new record will be blank. Of course, the new
record will not show up in the pull down box unless I hit the
refresh button on the first form (contact) first before
hitting the call back button. So, if you're still with me,
what I am attempting to do is cause a refresh of the first
form while invoking the call back button (so the new contact
will appear in the drop down box without seperately hitting
the refresh button), and/or if possible when clicking on the
call back button, having a new call back record created, with
the current (new) contact already selected in the contact drop
down box. Here is my current code for the button:
add a line of code to save the new/changed record before opening
the form
Private Sub Calls_Click()
On Error GoTo Err_Calls_Click
if Me.Dirty = True then Me Dirty = False 'forces save of record,
>
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "CallsForm"

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

Exit_Calls_Click:
Exit Sub

Err_Calls_Click:
MsgBox Err.Description
Resume Exit_Calls_Click

End Sub



--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 14 '07 #3

P: n/a
On Aug 13, 10:55 pm, "tina" <nos...@address.comwrote:
well, if i understand you correctly, the combo box you're concerned with is
on the second form, not the first form. sounds to me like you just need to
write the first form's record to disk before calling the second form. try
the following, as

Private Sub Calls_Click()
On Error GoTo Err_Calls_Click

Dim stDocName As String
Dim stLinkCriteria As String

If Me.Dirty Then Me.Dirty = False
stDocName = "CallsForm"
stLinkCriteria = "[Company]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Calls_Click:
Exit Sub

Err_Calls_Click:
MsgBox Err.Description
Resume Exit_Calls_Click

End Sub

hth

"magmike" <magmi...@yahoo.comwrote in message

news:11**********************@g4g2000hsf.googlegro ups.com...
I have a contact form that once the contact information is filled out,
a button is pressed by the user to pull up another form that schedules
a call back date and time for that record. If you hit that button on
a current record that already has a call back scheduled, it will show
that information for that contact already in the form. If nothing is
scheduled, the pull down box for that new record will be blank. Of
course, the new record will not show up in the pull down box unless I
hit the refresh button on the first form (contact) first before
hitting the call back button. So, if you're still with me, what I am
attempting to do is cause a refresh of the first form while invoking
the call back button (so the new contact will appear in the drop down
box without seperately hitting the refresh button), and/or if possible
when clicking on the call back button, having a new call back record
created, with the current (new) contact already selected in the
contact drop down box. Here is my current code for the button:
Private Sub Calls_Click()
On Error GoTo Err_Calls_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CallsForm"
stLinkCriteria = "[Company]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Calls_Click:
Exit Sub
Err_Calls_Click:
MsgBox Err.Description
Resume Exit_Calls_Click
End Sub- Hide quoted text -

- Show quoted text -
That's awesome, thanks!

Aug 15 '07 #4

P: n/a
you're welcome :)
"magmike" <ma******@yahoo.comwrote in message
news:11**********************@50g2000hsm.googlegro ups.com...
On Aug 13, 10:55 pm, "tina" <nos...@address.comwrote:
well, if i understand you correctly, the combo box you're concerned with
is
on the second form, not the first form. sounds to me like you just need
to
write the first form's record to disk before calling the second form.
try
the following, as

Private Sub Calls_Click()
On Error GoTo Err_Calls_Click

Dim stDocName As String
Dim stLinkCriteria As String

If Me.Dirty Then Me.Dirty = False
stDocName = "CallsForm"
stLinkCriteria = "[Company]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Calls_Click:
Exit Sub

Err_Calls_Click:
MsgBox Err.Description
Resume Exit_Calls_Click

End Sub

hth

"magmike" <magmi...@yahoo.comwrote in message

news:11**********************@g4g2000hsf.googlegro ups.com...
I have a contact form that once the contact information is filled out,
a button is pressed by the user to pull up another form that schedules
a call back date and time for that record. If you hit that button on
a current record that already has a call back scheduled, it will show
that information for that contact already in the form. If nothing is
scheduled, the pull down box for that new record will be blank. Of
course, the new record will not show up in the pull down box unless I
hit the refresh button on the first form (contact) first before
hitting the call back button. So, if you're still with me, what I am
attempting to do is cause a refresh of the first form while invoking
the call back button (so the new contact will appear in the drop down
box without seperately hitting the refresh button), and/or if possible
when clicking on the call back button, having a new call back record
created, with the current (new) contact already selected in the
contact drop down box. Here is my current code for the button:
Private Sub Calls_Click()
On Error GoTo Err_Calls_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CallsForm"
stLinkCriteria = "[Company]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Calls_Click:
Exit Sub
Err_Calls_Click:
MsgBox Err.Description
Resume Exit_Calls_Click
End Sub- Hide quoted text -
- Show quoted text -

That's awesome, thanks!

Aug 16 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.