|
|
Dear
I have form (its name is frmproduct) containing the following records (the resource record is Products table): Barcode ----> primary key itemName ----> Memo ItemNo ----> Number
the primary key (barcode) has this format X10-1234 I creaded a parameter query (its name is FindProduct) to search on the itemname. if I run this query, it will give me a pop up box asking to enter any part of the item name. the query works fine. I created a new form (its name is frmFindProduct) based on this query, when i open this form it'll give me a pop up box asking to enter any part of the item name. and i get the needed result. on this form I created a command button, when i click it, it should open the main form (frmProduct) to see more details about the product. the following code has been embeded on this button, when i click it:
Private Sub cmdProductRecDetail_Click() ' Open the details for the selected record on the related form DoCmd.OpenForm "frm_product", wherecondition:="barcode = " & Me.BarCode End Sub
when I click the button to see more detail, it give me a pop up box asking me to enter the remaining part of the barcode (primar Key). (i.e. the part after X10).
could you please help me to solve this issue?
|
|
My first guess is that the following part of your code
[Quoted Text] > DoCmd.OpenForm "frm_product", wherecondition:="barcode = " & Me.BarCode
.... I beleive Me.BarCode is the name of your search box where the user is entering a portion of the field. If this is the case, then what you are wanting to do is change what field the WhereCondition is searching on. My reommendation is actually the Primary Key field.
Now that I look at it closer, the Me.BarCode, should actually be the Primary Key field, but the Me. says that you are referencing the Form control name, which may not necessarily be the name of the data field that you are using - though usually it is, so now I'm at a a loss.
I do believe that you are running into some sort of referencing issue, similar to what I am saying - though after taking a second look, I think I'm close to what's wrong, but I do believe I'm slightly off the mark.
In order to find out exactly, I believe I would need to look at the database file. If you are willing and able to, go ahead and send the file directly to my email account RobertXlXAustin[ at ]gXmail.com (remove the X's (you may want to remove any of the other objects and unrelated tables/queries/etc.)
"Fahad" <Fahad[ at ]discussions.microsoft.com> wrote in message news:5BB6CF29-C364-46B1-8F5C-01F96AC2E362[ at ]microsoft.com... > Dear > > I have form (its name is frmproduct) containing the following records (the > resource record is Products table): > Barcode ----> primary key > itemName ----> Memo > ItemNo ----> Number > > the primary key (barcode) has this format X10-1234 > I creaded a parameter query (its name is FindProduct) to search on the > itemname. if I run this query, it will give me a pop up box asking to > enter > any part of the item name. the query works fine. > I created a new form (its name is frmFindProduct) based on this query, > when > i open this form it'll give me a pop up box asking to enter any part of > the > item name. and i get the needed result. on this form I created a command > button, when i click it, it should open the main form (frmProduct) to see > more details about the product. > the following code has been embeded on this button, when i click it: > > Private Sub cmdProductRecDetail_Click() > ' Open the details for the selected record on the related form > DoCmd.OpenForm "frm_product", wherecondition:="barcode = " & Me.BarCode > End Sub > > when I click the button to see more detail, it give me a pop up box asking > me to enter the remaining part of the barcode (primar Key). (i.e. the part > after X10). > > could you please help me to solve this issue?
|
|
"Fahad" <Fahad[ at ]discussions.microsoft.com> wrote in message news:5BB6CF29-C364-46B1-8F5C-01F96AC2E362[ at ]microsoft.com...
[Quoted Text] > Dear > > I have form (its name is frmproduct) containing the following records (the > resource record is Products table): > Barcode ----> primary key > itemName ----> Memo > ItemNo ----> Number > > the primary key (barcode) has this format X10-1234 > I creaded a parameter query (its name is FindProduct) to search on the > itemname. if I run this query, it will give me a pop up box asking to > enter > any part of the item name. the query works fine. > I created a new form (its name is frmFindProduct) based on this query, > when > i open this form it'll give me a pop up box asking to enter any part of > the > item name. and i get the needed result. on this form I created a command > button, when i click it, it should open the main form (frmProduct) to see > more details about the product. > the following code has been embeded on this button, when i click it: > > Private Sub cmdProductRecDetail_Click() > ' Open the details for the selected record on the related form > DoCmd.OpenForm "frm_product", wherecondition:="barcode = " & Me.BarCode > End Sub > > when I click the button to see more detail, it give me a pop up box asking > me to enter the remaining part of the barcode (primar Key). (i.e. the part > after X10). > > could you please help me to solve this issue?
If BarCode is a text field, you need to enclose the value in quotes:
DoCmd.OpenForm "frm_product", _ WhereCondition:="barcode = '" & Me.BarCode & "'"
In this case, I've used single-quotes ('), assuming that no barcode will ever contain that character.
-- Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup)
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0049_01C9482D.F4024F10 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 8bit
Curriculum vitae.
Target position: Remote MS Access developer.
I have SQL Server 2005 Express and can develop full-featured client-server application.
Name: Sergey Alexandrovich Topychkanov.
Birthday: 14th of February, 1971.
Location: Moscow, Russia.
Languages: Russian- fluent, English- fluent, French- basic, Italian- basic.
Education: Moscow College #34. Diploma thesis “Internal architecture of processors Intel 8086/8088â€
Professional experience: MS Access (SQL, VBA) for more than 10 years of expertise, ASP.NET, C# and MS SQL Server.
I served as programmer in KGB USSR in 1989-1991, and my software was also used then by Soviet Aerospace Agency.
I developed first multimedia e-tutor in Russia of English language for children in 1991.
I was member of team developing Russian compiler with own DBMS Orthodox 1992-1994
Since then I worked as freelancer in Moscow developing mostly MS Access projects.
Desirable salary: 1500 usd monthly
My address: S.A.Topychkanov, Nikitinskaya Ulitsa, dom 9, kvartira 37, Moscow, Russia, 105037.
My phone: +7 499 1664378
My mobile: +7 903 6256177
My email: SergeyTopychkanov[ at ]gmail.com,SergeyTopychkanov[ at ]live.ru
I have new books on T-SQL 2008, MS Access 2007, VBA, ASP.NET, LINQ, Ajax and so on.
I’m looking for temporary or better steady job as remote part of your programming team.
Due to my circumstances (I have disabled person in my care) I cannot leave Moscow and relocate to your place.
My web site with examples of my MS Access skills is at http://topaccess.by.ru
------=_NextPart_000_0049_01C9482D.F4024F10 Content-Type: image/jpeg; name="clip_image001.jpg" Content-Transfer-Encoding: base64 Content-ID: <8653D5B2EA864D31A6A5948BF5B1795A[ at ]SAINTROYALPC>
/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAPAAA/+4ADkFkb2JlAGTAAAAAAf/b AIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoKDBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxsc Hx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f Hx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAUABEAwERAAIRAQMRAf/EAIkAAAICAwEAAAAAAAAAAAA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