Access/VBA Conditional Statement
- From: davy d <davedmd_usa@xxxxxxxxxxx>
- Date: Sat, 29 Apr 2006 17:53:22 GMT
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
*** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: Access/VBA Conditional Statement
- From: Wayne Morgan
- Re: Access/VBA Conditional Statement
- Prev by Date: Re: go to a record in a form
- Next by Date: Re: Relationships. Does anyone use them?
- Previous by thread: coordinating file management
- Next by thread: Re: Access/VBA Conditional Statement
- Index(es):
Relevant Pages
|