Simplifying Function Problem

strikeuk

Registered User.
Local time
Today, 15:54
Joined
Dec 30, 2005
Messages
12
Hi, how do i simplify this function? I tried substituting the value 1 so it becomes like this but i get the "Expected: end of statement" error. Can anyone help? Thanks

Code:
Function StdRow1Enabled(Value As String)

    Forms!F_ReceivingStandardParts!subform1.Form!txtBalQty1b.Enabled = Value

End Function

Code:
Function StdRow1Enabled(Num As Integer, Value As String)

    Forms!F_ReceivingStandardParts!subform1.Form!txtBalQty(Num)b.Enabled = Value

End Function
 
As 'value' is controling visible it should be a boolean not a string.

How are you calling it?

Peter
 
Ok basically what i want is for a field to be visible or not visible base on a certain condition. I'm able to do this but the problem comes when i'm trying to maintain 6 rows with each row containing 5 textboxes. I'm trying to make it easier to perform any modifications.

This is how i call it, instead of

If IsNull(Me![txtDate1]) = False Then
StdRow1Enabled ( False )
End IF

i could do it like this

If IsNull(Me![txtDate1]) = False Then
StdRowEnabled (1, False ) 'for row 1
StdRowEnabled (2, True ) 'for row 2
End IF
 
Last edited:
Function StdRow1Enabled(Value As boolean)

But if this is a continous form I don't think that you can hide textboxes by rows, only for the form as a whole

Peter
 
I'm actually using a single unbound form, due to some limitations for continuous form.
 
try:-
Code:
Function StdRow1Enabled(intRow As Integer, bolShow As Boolean)

    Forms!F_ReceivingStandardParts!subform1.Form!("txtBalQty" & intRow & "b").Enabled = bolShow

End Function
 
I'm getting this error "Expected: =" as soon as i tried
Code:
StdRow1Enabled (1,False)
 
try
Call StdRow1Enabled(1, False)

peter
 

Users who are viewing this thread

Back
Top Bottom