C
Chris Nebinger
You need to set up the Function as:
Public Function Height(strFrom as String) as String
Then Call it by:
Select tblPltMvs.From, tblPltMvs.To, height
(tblPltMvs.From) AS Expr1
One thing. Strings can not handle null values. If you
have any records without the From field filled in, you
will get an error. Change that by:
Public Function Height(strFrom as Variant) as Variant
Chris Nebinger
with SQL code:
the floor based on [from] slot number. Slots are
designated as such:
when I put it as height(from as string), it's not working.
Public Function Height(strFrom as String) as String
Then Call it by:
Select tblPltMvs.From, tblPltMvs.To, height
(tblPltMvs.From) AS Expr1
One thing. Strings can not handle null values. If you
have any records without the From field filled in, you
will get an error. Change that by:
Public Function Height(strFrom as Variant) as Variant
Chris Nebinger
expression height()" when I try to run an Access query-----Original Message-----
Good morning,
I have been getting an error: "Ambigous name. in query
with SQL code:
value (height) that gives the height of the pallet fromSELECT tblPltMvs.From, tblPltMvs.To, height() AS Expr1
FROM tblPltMvs;
My VBA function is below. It is supposed to return a
the floor based on [from] slot number. Slots are
designated as such:
slots and numbers denote PICK/SELECTION slots.Aisle (1-2 letters)
Bay (numbers)
Slot (1 letter or 2 numbers) - letters denote RESERVE
"DOOR" is at the center of the dock
Public Function Height()
Dim FLevel As String
If Right([from], 1) <> "E" And Right([from], 1) <> "F"
to pass the 'from' slot number into the function, but evenAnd Right([from] said:If [from] = "DOOR" Then FLevel = "0"
If Right([from], 2) = "10" Then FLevel = "A"
If Right([from], 2) = "20" Then FLevel = "C"
Else: FLevel = Right([from], 1)
End If
Select Case FLevel
Case "A"
Height = 0
Case "C"
Height = 52.5
Case "1", "2", "3", "4", "5"
Height = 0
Case "E"
Height = 103
Case "F"
Height = 155
Case "G"
Height = 206.5
Case "T"
Height = 258
End Select
End Function
Can someone please tell me what I am doing wrong? I need
when I put it as height(from as string), it's not working.