| | |
VBA Combo Box Problem
Thread Solved |
•
•
Join Date: Sep 2006
Posts: 20
Reputation:
Solved Threads: 0
Hi Guys,
I just need a bit of help in VBA.
What I'm trying to do is to open report from a form. The reports are based on Query.
The form consists of a combo box and a command button. What I want to do is to select the condition of opening the report from combo box and open that report.
Following is the code I'm using
1) Dealer = Form!DEALER_COMBO.Value
2) DoCmd.OpenReport "SALES REPORT", acViewPreview, , "[OKCUNM] = 'BATALION MOTORS'"
3)Text9.SetFocus
Text9.Text = Me.DEALER_COMBO.Value
4)DoCmd.OpenReport "SALES REPORT", acViewPreview, , "[OKCUNM]" = Form!DEALER_COMBO.Value
The second and third lines of code are just tests. OKCUNM is a field on the report which is running on a query.
If I comment line 4 everything works fine with the set condition in line 2, but I want the condition to be fulfilled by combo box which I'm trying to do in line 4.
In line 4 the value from Form!DEALER_COMBO.Value is not getting stored in OKCUNM
Please Help
I just need a bit of help in VBA.
What I'm trying to do is to open report from a form. The reports are based on Query.
The form consists of a combo box and a command button. What I want to do is to select the condition of opening the report from combo box and open that report.
Following is the code I'm using
1) Dealer = Form!DEALER_COMBO.Value
2) DoCmd.OpenReport "SALES REPORT", acViewPreview, , "[OKCUNM] = 'BATALION MOTORS'"
3)Text9.SetFocus
Text9.Text = Me.DEALER_COMBO.Value
4)DoCmd.OpenReport "SALES REPORT", acViewPreview, , "[OKCUNM]" = Form!DEALER_COMBO.Value
The second and third lines of code are just tests. OKCUNM is a field on the report which is running on a query.
If I comment line 4 everything works fine with the set condition in line 2, but I want the condition to be fulfilled by combo box which I'm trying to do in line 4.
In line 4 the value from Form!DEALER_COMBO.Value is not getting stored in OKCUNM
Please Help
![]() |
Similar Threads
- Combo box problem (Java)
- Combo box selection problem (VB.NET)
- Perplexed: Combo Box Not Holding Data (C#)
- combo box (PHP)
- combo box (ASP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: IsNull using VB 6 and SQL SERVER 2000
- Next Thread: Updating ADODC
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





