The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Lookup Edit
Posted: 19 Jun 07 11:12 AM
|
How can I pass lookup parameters by VBscript? I would use radio buttons to change the lookup from contact last name to account lookup.
thx |
|
|
|
Re: Lookup Edit
Posted: 20 Jun 07 6:39 AM
|
One way we have done this is to employ 2 (two) different lookups. Have one visible... the other not. Use the RadioGroup event and check the index to see which lookup should be visible (or not).
Less messy. -- rjl |
|
|
|
Re: Lookup Edit
Posted: 20 Jun 07 9:15 AM
|
Here is an example I used to change the lookup based on the lookup id of another lookup. This could be modified to check the value from the radio group instead of a lookup. Sub lueAccountChange(Sender) If lueAccount.LookupID = "" Then lueBillingAddress.LookupRestrictValue = txtAcctID.Text luePaidFrom.LookupRestrictValue = txtAcctID.Text Else lueBillingAddress.LookupRestrictValue = lueAccount.LookupID luePaidFrom.LookupRestrictValue = lueAccount.LookupID End If End Sub
select case rgHowPaid.ItemIndex case 0 lueBillingAddress.LookupRestrictValue = txtAcctID.Text luePaidFrom.LookupRestrictValue = txtAcctID.Text case 1 lueBillingAddress.LookupRestrictValue = lueAccount.LookupID luePaidFrom.LookupRestrictValue = lueAccount.LookupID end select |
|
|
|
Re: Lookup Edit
Posted: 21 Jun 07 7:14 AM
|
2 control way: A - Create two lue's: lueContact/lueAccount and place them on top of each other B - Design Time: uncheck lueAccount.Visible C - Design Time:Radio group: Set index to 0 D - Code tied to RG (off the top of my head.. NOT tested...):
Sub RC(Sender) If Sender.Index = 0 Then If lueAccount.Visible = True Then Exit sub 'saves a screen repaint  Else lueAccount.Visible = True lueContact.Visible = False End If Else If lueContact.Visible = True Then Exit sub 'saves a screen repaint  Else lueContact.Visible = True lueAccount.Visible = False End If End Sub
-- rjl |
|
|
|