D
DS
I have a Form called "AddItems" with a Search Button on it. When you
click it a Search Form opens up called "AddItemsSearch" which has
unbound fields on it. I enter the info into it, then click a done
button which closes "AddItemsSearch" and opens "AddItems". If I use
only one of he criteria listed below, Price or ID and REM out the others
in the code it works fine. However when I start adding other criteria
by taking off the rem the code doesn't work. Any help is appreciated.
This has been going on for a couple of Days now. Also will this handle
Null or am I missing this also.
Thanks
DS
Private Sub Command73_Click()
On Error GoTo Err_cmdOpenResult_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "AddItems"
stLinkCriteria = "[ItemID]=" & Me![SearchID] & _
"[ItemID] = " & Me![SearchID] & _
"[ItemName]= " & Me![SearchName] & _
"[ItemPrice]= " & Me![SearchPrice] & _
"[ItemType] = " & Me![SearchType] & _
"[ItemMenu] = " & Me![SearchMenu] & _
"[ItemSalesCat] = " & Me![SearchSales] & _
"[ItemMajorCat] = " & Me![SearchMajor] & _
"[ItemMinorCat] = " & Me![SearchMinor] & _
"[ItemPrepCat] = " & Me![SearchPrep] & _
"[ItemActive] = " & Me![SearchActive]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenResult_Click:
Exit Sub
Err_cmdOpenResult_Click:
MsgBox Err.Description
Resume Exit_cmdOpenResult_Click
End Sub
LIST OF FIELD TYPES
[ItemID] Number
[ItemName] Text
[ItemPrice] Currency
[ItemType] Combo with Value "Main"; "Modifier"
[ItemMenu] Combo with 2 rows, 1st Bound (Number), (Text)
[ItenSalesCat] Combo with 2 rows, 1st Bound (Number), (Text)
[ItemMajorCat] Combo with 2 rows, 1st Bound (Number), (Text)
[ItemMinorCat] Combo with 2 rows, 1st Bound (Number), (Text)
[ItemPrepCat] Combo with 2 rows, 1st Bound (Number), (Text)
[ItemActive] Yes/No
All of the Search Fields are on the "AddItemsSearch" Form
click it a Search Form opens up called "AddItemsSearch" which has
unbound fields on it. I enter the info into it, then click a done
button which closes "AddItemsSearch" and opens "AddItems". If I use
only one of he criteria listed below, Price or ID and REM out the others
in the code it works fine. However when I start adding other criteria
by taking off the rem the code doesn't work. Any help is appreciated.
This has been going on for a couple of Days now. Also will this handle
Null or am I missing this also.
Thanks
DS
Private Sub Command73_Click()
On Error GoTo Err_cmdOpenResult_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "AddItems"
stLinkCriteria = "[ItemID]=" & Me![SearchID] & _
"[ItemID] = " & Me![SearchID] & _
"[ItemName]= " & Me![SearchName] & _
"[ItemPrice]= " & Me![SearchPrice] & _
"[ItemType] = " & Me![SearchType] & _
"[ItemMenu] = " & Me![SearchMenu] & _
"[ItemSalesCat] = " & Me![SearchSales] & _
"[ItemMajorCat] = " & Me![SearchMajor] & _
"[ItemMinorCat] = " & Me![SearchMinor] & _
"[ItemPrepCat] = " & Me![SearchPrep] & _
"[ItemActive] = " & Me![SearchActive]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenResult_Click:
Exit Sub
Err_cmdOpenResult_Click:
MsgBox Err.Description
Resume Exit_cmdOpenResult_Click
End Sub
LIST OF FIELD TYPES
[ItemID] Number
[ItemName] Text
[ItemPrice] Currency
[ItemType] Combo with Value "Main"; "Modifier"
[ItemMenu] Combo with 2 rows, 1st Bound (Number), (Text)
[ItenSalesCat] Combo with 2 rows, 1st Bound (Number), (Text)
[ItemMajorCat] Combo with 2 rows, 1st Bound (Number), (Text)
[ItemMinorCat] Combo with 2 rows, 1st Bound (Number), (Text)
[ItemPrepCat] Combo with 2 rows, 1st Bound (Number), (Text)
[ItemActive] Yes/No
All of the Search Fields are on the "AddItemsSearch" Form