Microsoft
Software
Hardware
Network
Question : Open form based on two unbound combo boxes on another form
I have a form named frmWorkAndBack based on a table tblWorkAndBack.
The table has two Integer fields QuoteNumber and QuoteLine.
I have a button a form frmSelectOrder with two unbound fields cboQuoteNumber and cboLineNumber.
I want to open the form frmWorkAndBack based on the values in in frmSelectOrder
If I use the command
DoCmd.OpenForm "frmWorkAndBack", , , "[QuoteHeader]=" & Me.cboQuoteNumber
the form opens and is filtered by the QuoteHeader value.
If I use this code:
DoCmd.OpenForm "frmWorkAndBack", , , "[QuoteLine]=" & Me.cboLineNumber
the form opens and is filtered by the QuoteLine
However, when I use this code:
DoCmd.OpenForm "frmWorkAndBack", , , "[QuoteHeader]=" & Me.cboQuoteNumber And "[QuoteLine]=" & Me.cboLineNumber
I receive Run-time error '13'"
Type mismatch
I would think I would get a Type mismatch on one or the other, but they both work when not combined.
Thanks in advance.
Answer : Open form based on two unbound combo boxes on another form
You simply misplaced the quote:
DoCmd.OpenForm "frmWorkAndBack", , , "[QuoteHeader]=" & Me.cboQuoteNumber & " And [QuoteLine]=" & Me.cboLineNumber
The And was being interpreted by VB, while you want it as part of your criteria.
(°v°)
Random Solutions
KMS Activation Multiple Keys
Complete memory dump not available for servers with >=2GB RAM : other options WinDbg : blue screen crash
How to separate multiple email accounts into different data files in Outlook 2010
Video Chat Capabilities
A non-SYN packet was dropped because it was sent by a source that does not have an established connection with the Forefront TMG computer
Setting Up Raid On Windows 2003 Server With Faulty Hard Drive
CMDKEY error message
sbs 2008 backup configuration
Setting msExchMailboxSecurityDescr
iptor with VB.NET
run excel and run the enable auto refresh