473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

pulling only 1 record from BE

72 64KB
Hi,
I am fairly new to access.
I would like to click a customer name in a textbox in my main form and have a pop up form that shows details of that customer. Everywhere I look (Northwind too), it seems that a simple where condition (eg customerID) will do the job.
BUT..
that means that all of the customers in the table will be pulled in the pop up form recordset but only 1 shown.
So if I have 5000 customers and want to change the phone number of 1, access pulls everything and shows 1?

So, is the only way to actually load 1 customer to write a criteria in the query itself? I don't want the user to be able to navigate through the recordset in the popup form so I don't see the point of loading everything.

Thanks
Mar 22 '17 #1

✓ answered by jforbes

When supplying the WhereCondition for DoCmd.OpenForm, it will limit the Record Source in the Form to only those records that satisfy the Where Condition.

So, if you have a Customer Table with a Primary Key of CustomerID and a Form called frmCustomer, if you were to open frmCustomer with the following:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "frmCustomer", , , "CustomerID=12"
only one record will be loaded into the Form.

3 805
jforbes
1,107 Expert 1GB
When supplying the WhereCondition for DoCmd.OpenForm, it will limit the Record Source in the Form to only those records that satisfy the Where Condition.

So, if you have a Customer Table with a Primary Key of CustomerID and a Form called frmCustomer, if you were to open frmCustomer with the following:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "frmCustomer", , , "CustomerID=12"
only one record will be loaded into the Form.
Mar 22 '17 #2
Neruda
72 64KB
that's what I thought. But I have
DoCmd.OpenForm "frmPartyBook", acNormal, , Me!PartyID, acFormEdit, acDialog, "Change Booking ID "

if I debug.print the recorset of my pop up form I can see that all records are there but 1 shown (filtered). Why?
Mar 22 '17 #3
Neruda
72 64KB
I got iwrong here..
DoCmd.OpenForm "frmPartyBook", acNormal, , Me!PartyID, acFormEdit, acDialog, "Change Booking ID "


should be
DoCmd.OpenForm "frmPartyBook", acNormal, , "PartyID=" & Me!PartyID, acFormEdit, acDialog, "Change Booking ID "
Thanks
Mar 23 '17 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tony | last post by:
Thanks for writing back and don't laugh at what I am about to post I am new to this type of stuff....this is what I have tried and it isn't working(please note in the try section I was just trying...
4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
1
by: Skully Matjas | last post by:
Thank you for getting back to me. I am very new at this so i didnot understand what you said, here i will give as much cetails as possible: 1) The combo box i am using is combox39 2) I imported...
8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
3
by: John Ortt | last post by:
> I have a table of dates in ascending order but with varying intervals. I > would like to create a query to pull out the date (in field 1) and then pull > the date from the subsequent record...
3
by: piscogirl | last post by:
Hi there, I am about to build a small db in Access. Among the tables I plan to have are a Person table, an Event table, and an EventRegistration table. The EventRegistration table will...
1
by: xx75vulcan | last post by:
I have created an ASP page that will "on the fly" create an XML feed from my MS SQL database and the contents within a specified table. The Feed: http://www.rockwood.k12.mo.us/news/rss.asp You...
5
by: Swinky | last post by:
I have a form "AccountInfo" that contains company names. I have inserted a subform "Contacts" with contact names and have established parent/child relationships between the two forms. All works...
1
by: Himmel | last post by:
I may be brain-fried, but I could use some help again. One of my glorious forms in my multi-form report thingiemajigger is a tabular form. For example, it shows customer items purchased and the...
12
by: tekctrl | last post by:
Environment; Win2K PC with 1Gb of RAM and plenty of HD space running Access 2002 Issue; Access presents a blank data entry form in the Forms view when the New Record icon is used. However, it...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.