option group

P

Penny

I'm having problems with option groups my check box is blank. The following
is my code. Please help!!! Thank you!!!

Private Sub PendingandClosed_AfterUpdate()

If Me!PendingandClosed = 1 Then
cboCustomerNames.RowSource = "SELECT tblCustomerInfo.[Customer Name],
tblTransactionInformation.[Status of Deal] FROM tblTransactionInformation
INNER JOIN tblCustomerInfo ON tblTransactionInformation.[Customer Name] =
tblCustomerInfo.[Customer Name] WHERE (((tblTransactionInformation.[Status of
Deal])= &Pending)) ORDER BY tblCustomerInfo.[Customer Name]"

Else

cboCustomerNames.RowSource = "SELECT tblCustomerInfo.[Customer Name],
tblTransactionInformation.[Status of Deal] FROM tblTransactionInformation
INNER JOIN tblCustomerInfo ON tblTransactionInformation.[Customer Name] =
tblCustomerInfo.[Customer Name] WHERE (((tblTransactionInformation.[Status of
Deal])= &closed)) OR (((tblTransactionInformation.[Status of Deal])=&dead))"



End If
End Sub
 
O

Ofer

You should write more about what is the problem
but just incase the Me!PendingandClosed will be null it might cause problem,
in that case try and write
If nz(Me!PendingandClosed,0) = 1 Then
 
P

Penny

I have an Option Group, using check boxes for selection.1 = Pending and 2 =
Closed. When 1 is checked in my unbound combo box I want all Pending deals to
be listed in a drop down box and the same for 2. My below coding isn't
working any help would be great!! Thanks!

Ofer said:
You should write more about what is the problem
but just incase the Me!PendingandClosed will be null it might cause problem,
in that case try and write
If nz(Me!PendingandClosed,0) = 1 Then



Penny said:
I'm having problems with option groups my check box is blank. The following
is my code. Please help!!! Thank you!!!

Private Sub PendingandClosed_AfterUpdate()

If Me!PendingandClosed = 1 Then
cboCustomerNames.RowSource = "SELECT tblCustomerInfo.[Customer Name],
tblTransactionInformation.[Status of Deal] FROM tblTransactionInformation
INNER JOIN tblCustomerInfo ON tblTransactionInformation.[Customer Name] =
tblCustomerInfo.[Customer Name] WHERE (((tblTransactionInformation.[Status of
Deal])= &Pending)) ORDER BY tblCustomerInfo.[Customer Name]"

Else

cboCustomerNames.RowSource = "SELECT tblCustomerInfo.[Customer Name],
tblTransactionInformation.[Status of Deal] FROM tblTransactionInformation
INNER JOIN tblCustomerInfo ON tblTransactionInformation.[Customer Name] =
tblCustomerInfo.[Customer Name] WHERE (((tblTransactionInformation.[Status of
Deal])= &closed)) OR (((tblTransactionInformation.[Status of Deal])=&dead))"



End If
End Sub
 
O

Ofer

Try this
Private Sub PendingandClosed_AfterUpdate()

If Me!PendingandClosed = 1 Then
cboCustomerNames.RowSource = "SELECT tblCustomerInfo.[Customer Name],
tblTransactionInformation.[Status of Deal] FROM tblTransactionInformation
INNER JOIN tblCustomerInfo ON tblTransactionInformation.[Customer Name] =
tblCustomerInfo.[Customer Name] WHERE (((tblTransactionInformation.[Status of
Deal])= 'Pending')) ORDER BY tblCustomerInfo.[Customer Name]"

Else

cboCustomerNames.RowSource = "SELECT tblCustomerInfo.[Customer Name],
tblTransactionInformation.[Status of Deal] FROM tblTransactionInformation
INNER JOIN tblCustomerInfo ON tblTransactionInformation.[Customer Name] =
tblCustomerInfo.[Customer Name] WHERE (((tblTransactionInformation.[Status of
Deal])= 'closed')) OR (((tblTransactionInformation.[Status of
Deal])='dead'))"



End If
End Sub

Penny said:
I have an Option Group, using check boxes for selection.1 = Pending and 2 =
Closed. When 1 is checked in my unbound combo box I want all Pending deals to
be listed in a drop down box and the same for 2. My below coding isn't
working any help would be great!! Thanks!

Ofer said:
You should write more about what is the problem
but just incase the Me!PendingandClosed will be null it might cause problem,
in that case try and write
If nz(Me!PendingandClosed,0) = 1 Then



Penny said:
I'm having problems with option groups my check box is blank. The following
is my code. Please help!!! Thank you!!!

Private Sub PendingandClosed_AfterUpdate()

If Me!PendingandClosed = 1 Then
cboCustomerNames.RowSource = "SELECT tblCustomerInfo.[Customer Name],
tblTransactionInformation.[Status of Deal] FROM tblTransactionInformation
INNER JOIN tblCustomerInfo ON tblTransactionInformation.[Customer Name] =
tblCustomerInfo.[Customer Name] WHERE (((tblTransactionInformation.[Status of
Deal])= &Pending)) ORDER BY tblCustomerInfo.[Customer Name]"

Else

cboCustomerNames.RowSource = "SELECT tblCustomerInfo.[Customer Name],
tblTransactionInformation.[Status of Deal] FROM tblTransactionInformation
INNER JOIN tblCustomerInfo ON tblTransactionInformation.[Customer Name] =
tblCustomerInfo.[Customer Name] WHERE (((tblTransactionInformation.[Status of
Deal])= &closed)) OR (((tblTransactionInformation.[Status of Deal])=&dead))"



End If
End Sub
 
Top