on form load assign sql string to recordsource of form on Form Load event.

i.e.
        Me.RecordSource = "SELECT tblCustomer.*, 1 as RecCount, 
tblPhoneType.PhoneType, tblCustomerContactPhone.PhoneNumber, tblTitle.Title, 
IIf(IsNull([tblcustomercontact].[contactid]),Null,[tblcustomercontact].[LastName]
 
& ', ' & [tblcustomercontact].[firstName]) AS FullName, tblUser.User " _
            & "FROM tblTitle RIGHT JOIN (tblUser RIGHT JOIN (tblCustomer 
LEFT JOIN ((tblCustomerContact LEFT JOIN tblCustomerContactPhone ON 
tblCustomerContact.ContactId = tblCustomerContactPhone.ContactId) LEFT JOIN 
tblPhoneType ON tblCustomerContactPhone.PhoneTypeId = 
tblPhoneType.PhoneTypeId) ON tblCustomer.CustomerId = 
tblCustomerContact.CustomerId) ON tblUser.UserId = tblCustomer.SalesRepId) 
ON tblTitle.TitleId = tblCustomerContact.TitleId " _
            & "WHERE PhoneNumber like '" & txtphone & "';"







Regards,

Mark Bartnik
586 306 4090





>From: eliotchs <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: [Access VBA Central] on form assigned a different record source
>Date: Tue, 14 Mar 2006 22:09:18 -0000
>
>Can a form be assigned a different record source if
>for different forms.
>Example:
>form:ANQuestions uses recordsource IncidentData on Form1
>but  ANQuestions uses recordsource IncidentDataTemp on Form2
>same table structure just one is a temp.
>
>How can i assign the recordssource on Form1 or Form2?
>
>Thanks
>Joe
>
>
>
>




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessVBACentral/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to