help with select case and tab control with subforms

D

DawnTreader

sounds complicated doesn't it? here is how it looks:

http://img397.imageshack.us/my.php?image=newforms1es8.jpg

i am attempting to use a select case statement to filter the records that
show up for each tab within the "type" tab control form section.

the site form is based on a site table. that has a one to many relationship
with the product table. each of the yellow boxes indicate where data is
coming from the product table. each of the tabs with in the blue box labeled
"type" form needs to filter the products table based on the product type
field showing in the top thin yellow box. so when on the compressor tab, all
the data showing in the green "unit" form should relate to the unit serial #
in the thin yellow box at top.

if that serial number is related to a dispenser and not a compressor, i
would like the entire set of fields on the compressor tab to be locked or not
visible or show in some way that the current record is not a compressor.

what i am looking for is a bit of code help as to how to cause the effect i
want. currently i have tried this code:

Private Sub tabctrlProductType_Change()
Select Case ProductTypeID.Value
Case "Compressor"
.Filter = [ProductTypeID] = "Compressor"
.FilterOn = True
.Requery
Case "Dispenser"
.Filter = [ProductTypeID] = "Dispenser"
.FilterOn = True
.Requery
Case "Storage"
.Filter = [ProductTypeID] = "Storage"
.FilterOn = True
.Requery
Case "Fill Post"
.Filter = [ProductTypeID] = "Fill Post"
.FilterOn = True
.Requery
Case "Decanting Post"
.Filter = [ProductTypeID] = "Decanting Post"
.FilterOn = True
.Requery
Case Else
.FilterOn = False
.Requery
End Select
End Sub

i put this in the tab control's on change event, but it choked. i basically
borrowed this from a book, but i am not sure if this is the best way of doing
this.

if anyone has any suggestions or could help with code, please help. :)

thanks in advance. :)
 
A

Allen Browne

Designing a screenshot that include ads like that is a pretty lousy way of
trying to make money out of the newsgroups, whether this was done by you or
your isp.

In my view, your otherwise good question does not deserve an answer while
this nonsense is going on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top