Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange - one form updates itself, one doesn't

Status
Not open for further replies.

Norwich

MIS
Mar 3, 2002
336
GB
Hi,

I have a form with a calendar control - on selecting a date it opens two other forms. One form - "Pledges_Date" - uses a query as a control source, with a filter being passed from the mail form.

The second form - "Pledges_Date_New_Rep" - uses the selected date passed via OpenArgs to populate a text box.

If both of the two secondary forms are closed, selecting a date from the main form will open the two forms with the correct data. Upon selecting a new date again from the first form, the filtered form - "Pledges_Date" - will redisplay itself but the form with the text box - "Pledges_Date_New_Rep" - remains displaying the openargs passed date from when it was originally opened. If it is closed and a new date selected, it displays the correct date.

The code from the main form is:


#########################################

Private Sub ActiveXCtl0_DateClick(ByVal DateClicked As Date)


Dim datCalDate As Date 'variable to store selected date
Dim stDocName1 As String
Dim stDocName2 As String
Dim stLinkCriteria1 As String


datCalDate = ActiveXCtl0.Value


stDocName1 = "Pledges_Date"
stDocName2 = "Pledges_Date_New_Rep"

stLinkCriteria1 = "[PledgeDate]=" & "#" & datCalDate & "#"
DoCmd.OpenForm stDocName1, , , stLinkCriteria1
DoCmd.OpenForm stDocName2, , , , , , datCalDate

End Sub


############################################

So, upon dateclick, the form Pledges_date is redisplayed with the new filter, but the form Pledges_Date_New_Rep still displays the value of datCalDate of when it was first opened. (The text box's properties source is set to: "=[OpenArgs]")

Any thoughts welcome
 
Looking at it further - it appears that the openargs value passed through the openform command is not being updated at the second form.

Does openargs only work when the form is opened?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top