Form goes MIA!

  • Thread starter gchichester via AccessMonster.com
  • Start date
G

gchichester via AccessMonster.com

Can anyone see what would cause my form frmSearchEuropeNotice not
show after applying this filter?

I have verified the results via the MsgBox and the forms filter property as
having ..
"BookingNoticeShipper Like "dne*" AND BookingNoticeConsignee Like "beva*" in
the results,
but the form is a no show, the form tab is the only visable hint that there
should be a form.

Private Sub cmdSearchBookings_Click()
Dim frm As Form, strMsgShipper As String, strMsgConsignee As String
Dim strInputShipper As String, strInputConsignee As String, strFilter As
String
Dim strShipperConsignee As String

Forms!frmHomePort.Visible = False
DoCmd.OpenForm "frmSearchEuropeNotice"

Set frm = Forms!frmSearchEuropeNotice.Form

strMsgShipper = "Enter Shipper Name " _
& "followed by an asterisk."
strMsgConsignee = "Enter Consignee Name " _
& "followed by an asterisk."

strInputShipper = InputBox(strMsgShipper)
strInputConsignee = InputBox(strMsgConsignee)


If Not IsNull(srtInputShipper) Then
strFilter = strFilter & " AND ("_
& BuildCriteria("BookingNoticeShipper", dbText, strInputShipper)
End If

If Not IsNull(strInputConsignee) Then
strFilter = strFilter & " AND ("_
& BuildCriteria("BookingNoticeConsignee", dbText, strInputConsignee)
End If

'MsgBox Mid(strFilter, 6)

frm.Filter = Mid(strFilter, 6)

frm.FilterOn = True

End Sub

Thanks
Gilc
 
J

John W. Vinson

I have verified the results via the MsgBox and the forms filter property as
having ..
"BookingNoticeShipper Like "dne*" AND BookingNoticeConsignee Like "beva*" in
the results,
but the form is a no show, the form tab is the only visable hint that there
should be a form.

This phenomenon will happen when both of two conditions are true: the form's
Recordsource is not updateable (or the form is otherwise not updateable), so
you can't see the blank new record; AND the form contains no records, either
because its recordsource has no records or you've filtered all the records
out.
 
G

gchichester via AccessMonster.com

Thank You John,

You were right on target - I changed my filter and now working as expected.
 
G

gchichester via AccessMonster.com

John,
Thanks again for your last response.
I realized I needed another search option in my code so I added the following.


If Not IsNull(varInputBookingNumber) Then
strFilter = strFilter & " AND " & BuildCriteria("BookingNoticeBookingNo",
dbText, varInputBookingNumber)
End If

Received "Illegal function call", I discovered that my strInput boxes should
be Variant data type so I made the change
but I'm still receiving the same error when any one of the search criteria is
null/blank.

Dim varInputBookingNumber As Variant
Dim varInputShipper As Variant
Dim varInputConsignee As Variant

any and all suggestions would be appreciated

Gilc
 

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