M
Morgan Gartland via AccessMonster.com
I have a form that shows suppliers and a subform that shows the products
they supply. Some companies supply products in Bin sizes and other
companies supply products in lot sizes.
When a companies details are up on screen the following code shows me only
lot size or bin size dependant on which fields have been filled in on the
sub form.
Private Sub Form_Current()
If Me![Product_Subform]![BinSize] <> vbNullString Then
Me![Product_Subform]![BinSize].Visible = True
Me![Product_Subform]![BinSizelbl].Visible = True
Me![Product_Subform]![LotSize].Visible = False
Me![Product_Subform]![LotSizelbl].Visible = False
Else
Me![Product_Subform]![LotSize].Visible = True
Me![Product_Subform]![LotSizelbl].Visible = True
Me![Product_Subform]![BinSize].Visible = False
Me![Product_Subform]![BinSizelbl].Visible = False
End If
End Sub
--
i have previously had the first line as
If Me![Product_Subform]![BinSize] > 0 Then
--
My problem is when there is a company with no products at all i get the
"Run-Time Error '2427': the expression you have entered has no value". I
understand why i am getting this message but i cannot seem to be able to
rectify it. If anyone could help me out it would stop my head from exploding
Cheers
Morgan
they supply. Some companies supply products in Bin sizes and other
companies supply products in lot sizes.
When a companies details are up on screen the following code shows me only
lot size or bin size dependant on which fields have been filled in on the
sub form.
Private Sub Form_Current()
If Me![Product_Subform]![BinSize] <> vbNullString Then
Me![Product_Subform]![BinSize].Visible = True
Me![Product_Subform]![BinSizelbl].Visible = True
Me![Product_Subform]![LotSize].Visible = False
Me![Product_Subform]![LotSizelbl].Visible = False
Else
Me![Product_Subform]![LotSize].Visible = True
Me![Product_Subform]![LotSizelbl].Visible = True
Me![Product_Subform]![BinSize].Visible = False
Me![Product_Subform]![BinSizelbl].Visible = False
End If
End Sub
--
i have previously had the first line as
If Me![Product_Subform]![BinSize] > 0 Then
--
My problem is when there is a company with no products at all i get the
"Run-Time Error '2427': the expression you have entered has no value". I
understand why i am getting this message but i cannot seem to be able to
rectify it. If anyone could help me out it would stop my head from exploding
Cheers
Morgan