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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Links form by using Date field

Status
Not open for further replies.

2101

Technical User
May 5, 2001
1
IS
Hi, I am creating a link between form by using two fields in the link criteria one of the field is a date filed
Below are the code - ...

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmTotalActivity"
stLinkCriteria = "[activityNo]=" & Me![cboActivityNo] & " And [dateFrom] = " & Me![txtDateFrom]

DoCmd.OpenForm stDocName, , , stLinkCriteria

I know these have to do with using # but I have not had any success to find out where I should use #....
Please Help
jg

 

try:

stLinkCriteria = "[activityNo]=" & Me![cboActivityNo] & " And [dateFrom] = #" & Me![txtDateFrom] & "#"

or you may have to do this since the value in the text field is a string and not a date:

stLinkCriteria = "[activityNo]=" & Me![cboActivityNo] & " And [dateFrom] = #" & CDate(Me![txtDateFrom]) & "#"

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top