Hi,
New user here and using a ms access 97 database.
I have a form containing a list box which presents the contents of a table.
On double clicking a record, i need the record to be presented in a new form where further data can be added.
I set the event procedure against the list box on Double Click, i can then use the DoCmd.OpenForm "frmDataEnt ry" but how do i pass the value that ive selected (double clicked), to then populate the form?
Many tks
18 1873
the DoCmd systax is as follows - DoCmd.OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs)
You would be looking to set the WhereCondition which would make your docmd look something like this -
DoCmd.OpenForm "frmDataEntry",,,"[YourControl] = " & "'" &[ListBox] & "'""
"YourContro l" would be the name of the matching control on frmDataEntry
"ListBox" would be the name of the listbox you are double clicking on.
Don,
tks for the quick reply.Im now receiving a syntax error on the following code;
DoCmd.OpenForm "frmDataEnt ry", , , "[frmDataEntry.tx tRepairRef] = " & "'" & [lstEnquiry] & "'"""
To try and resolve I've tried it without the the form name eg;
DoCmd.OpenForm "frmDataEnt ry", , , "[txtRepairRef] = " & "'" & [lstEnquiry] & "'"""
I also tried replacing the form name and field with the table name and field.
Im going wrong somewhere
Appreciate any advice.
@Quizzed
It should be like this. - DoCmd.OpenForm "frmDataEntry", , , "[txtRepairRef] = " & "'" & [lstEnquiry] & "'""
And it looks like you have an extra " at the end
First set of quotes is " ' "
Second set of quotes is " ' " "
Let me know how it works.
Still receive the syntax error.
When i move away from the code, there is an additional " applied as the last character - Is this whats causing the syntax error and if so is there any way of stopping this?
Ok Try this instead -
Dim strCondition as string
-
strCondition = "[txtRepairRef] = " & """" & me.lstEnquiry & """"
-
DoCmd.OpenForm "frmDataEntry", , , strCondition
-
]
It now prompts me to enter the value for the field txtRepairRef
If i then enter a value which i know exists, it does then open the form but without any of the associated data from the underlying table.
Put the following line before the DoCmd line. and let me know what shows up in the message box.
I selected repair ref 999998 and when i dclick this now returns;
[lstEnquiry].[txtRepairRef]='999998' With an OK cmd button.
If i then select OK, it returns lstEnquiry.txtR epairRef and needs me to input a value.
Your mesbox should be showing
Please post back the exact code that you are using.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Sean C. |
last post by:
Helpful folks,
Most of my previous experience with DB2 was on s390 mainframe systems
and the optimizer on this platform always seemed very predictable and
consistent. Since moving to a WinNT/UDB 7.2 environment, the choices
the optimizer makes often seem flaky. But this last example really
floored me. I was hoping someone could explain why I get worse
response time when the optimizer uses two indexes, than when it uses
one. Some context:
|
by: Mike MacSween |
last post by:
Sorry if this is a bit off topic, but I can't seem to find a 'remote
control' newsgroup on my news server. And anyway I know Tony has some
experience of this.
The app is split FE/BE. I'd like remote access to at least the server,
hopefully the whole network. And to be able to upload/download, to install
new versions of the FE to the server (which then get sent up to the clients
at runtime).
What experience does anybody have of this....
|
by: Yannick Turgeon |
last post by:
Hello,
We are in the process of examining our current main application. We have to
do some major changes and, in the process, are questionning/validating the
use of MS Access as front-end. The application is relatively big: around 200
tables, 200 forms and sub-forms, 150 queries and 150 repports, 5GB of data
(SQL Server 2000), 40 users.
I'm wondering what are the disadvantages of using Access as front-end? Other
that it's not...
|
by: Olav.NET |
last post by:
I am a .NET/C++ developer who is supposed to do some work with Access.
I do not know much about it except for the DB part.
Questions:
*1*
I am looking for INTENSIVE books to get quickly up to speed.
I like books with practical exercises, and also with test questions (like
cert books)
*2*
|
by: Stephen Poley |
last post by:
I have the following situation:
- a table of employees, keyed on employee-id;
- a table of training sessions, keyed on session-id;
- a requirement to log who was present at which session, plus optional
extra textual information (e.g. "left early due to illness").
The solution I had in mind was:
1) create a presence table, keyed on employee-id and session-id,
containing a 'present' yes/no field and a comment text field;
2) cross-join...
| |
by: etuncer |
last post by:
Hello All,
I have Access 2003, and am trying to build a database for my small
company. I want to be able to create a word document based on the data
entered through a form. the real question is this: can Access create
the document and place it as an OLE object to the relevant table?
Any help is greatly appreciated.
Ricky
|
by: luvkling |
last post by:
hi, i am new to asp.net. i currently doin a website. i created a add form in this form the user need to add in the record n when they press the submit button it will add the record into the access database "dvd_rental" in the respective table in actor, director, movie. in the form for the actor n director there is a dropdown list for user to choose, if the actor or director is not in the dropdown list they need to key in the name. May i noe wat...
|
by: hyperpau |
last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding.
I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com).
Ergo, I will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge.
I would be using layman's words, or maybe, my own words as how I understand them, hoping, you will understand it the same way that...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |