Sabtu, 29 Juli 2017

Re: [MS_AccessPros] Populating a combo box

 

Duane,


Sorry that i should have addressed you on your reply. I by mistake addressed it to John.

Regards,
Khalid


---In MS_Access_Professionals@yahoogroups.com, <khalidtanweerburrah@...> wrote :

John,

Option Explicit was already set on this form, and under Debug Compile SacAct is greyed.

Regards,
Khalid


---In MS_Access_Professionals@yahoogroups.com, <duanehookom@...> wrote :

Khalid,


This could just be a simple spelling error that should have been found by setting Option Explicit and compiling your code.


Regards,

Duane




From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Saturday, July 29, 2017 12:09 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Populating a combo box
 


John,

Getting error:
Method or data member not found


Highlighting 
Me.cboReceiptsSubID.RowSource = "SELECT DISTINCT ReceiptSubID.ReceiptsSubID, ReceiptSubID.ReceiptsSubID_Description " & _
"FROM ReceiptSubID " & _
"WHERE Left(cboReceiptsSubID,3) = " & Me.cboRecieptsID

Regards,
Khalid


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Khalid-

You're passing cboReceiptsID to the query engine, and it has no clue what that is.  You have to pass the value.  Assuming ReceiptsID is a number, do this:

Me.cboReceiptsSubID.RowSource = "SELECT DISTINCT ReceiptSubID.ReceiptsSubID, ReceiptSubID.ReceiptsSubID_Description " & _

"FROM ReceiptSubID " & _

"WHERE Left(cboReceiptsSubID,3) = " & Me.cboRecieptsID


John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications
www.viescas.com
If you're at all interested in Microsoft Access or SQL Server, this is the place to be! Check out the book recommendations and all the cool links!


On Jul 29, 2017, at 18:38, khalidtanweerburrah@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

Hi all,

On my Continuous Form "Receipts" I have a Combo Box "cboReceiptsID" with Control Source "ReceiptsID" and Row Source:

SELECT ReceiptID.ReceiptsID, ReceiptID.ReceiptID_Description

FROM ReceiptID

ORDER BY ReceiptID.ReceiptsID;


ReceiptsID is Text field

I need after update of "cboReceiptsID" next Combo Box "cboReceiptsSubID" should populate with its Left 3 of ReceiptsID


cboReceiptsSubID is also Text Field


"cboReceiptsSubID" --> Control Source "ReceiptsSubID"

Row Source:

SELECT ReceiptSubID.ReceiptsSubID, ReceiptSubID.ReceiptsSubID_Description

FROM ReceiptSubID

ORDER BY ReceiptSubID.ReceiptsSubID;

 


I am struggling with following code and getting nothing on combo box "cboReceiptsSubID"


Private Sub cboReceiptsID_AfterUpdate()

Me.cboReceiptsSubID.RowSource = "SELECT DISTINCT ReceiptSubID.ReceiptsSubID, ReceiptSubID.ReceiptsSubID_Description " & _

"FROM ReceiptSubID " & _

"WHERE Left(cboReceiptsSubID,3) = cboReceiptsID"

End Sub


May be I'm totally wrong, that is why need help please.

Regards,
Khalid




__._,_.___

Posted by: khalidtanweerburrah@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar