I'm having a problem with an acess form linkin with another form.
My index in the main form is Autonumber (Rec#)
the 2nd form is called Record# and it is set for text.
The link criteria works well with linking these 2 forms together with
these conditiosn, here is the vb code: stLinkCriteria = "[Rec#]=" & "'"
& Me![Record#] & "'"
but the problem is when i try to create a query it wont work with the 2
tables since they arte mismatched.
numeric to text, switching the field to numeric is great for the query
but not for linking the 2 tables.
i tried this but it doesnt work: If DCount("*","Rec#","[Rec#] = " &
Me!Record# ") > 0
can anyone help with this VBcode? here is the entire piece:
stDocName = "Home"
stLinkCriteria = "[Rec#]=" & "'" & Me![Record#] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Wayne Morgan - 29 Apr 2006 23:09 GMT
If you change the data type to a number, you don't need the extra quotes in
the code. The extra quotes are text delimiters.
Example:
stLinkCriteria = "[Rec#]=" & Me.[Record#]
You shouldn't store numbers as text without a good reason to do so if the
number is actually to be used as a numeric value (i.e. not a phone number,
zip code, SSN, etc).

Signature
Wayne Morgan
MS Access MVP
> I'm having a problem with an acess form linkin with another form.
> My index in the main form is Autonumber (Rec#)
[quoted text clipped - 16 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***