473,383 Members | 1,759 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,383 software developers and data experts.

requery pop up form with parameter

72 64KB
Hi,
on a form I have 2 buttons, they both open the same popup form.

button a:
DoCmd.OpenForm "frmCustomers", acNormal, , , acFormAdd, acDialog

button b:
DoCmd.OpenForm "frmCustomers", acNormal, , strWHERE, acFormEdit, acDialog

the query behind the pop up is (shortened):
SELECT tblCustomers.CustomerID, tblCustomers.FirstName, tblCustomers.LastName, [FirstName] & " " & [LastName] AS FullName, tblCustomers.HomePhone, tblCustomers.MobilePhone, tblCustomers.FaxNumber,
FROM tblCustomers;

Regardless which button was pressed to open the popup form, i need to be able to have the option to select a customer in a combobox on the popup form (contains list of customers)and have 1 record in the popup form recordset (using the combobox afterupdate event). I was looking as querydef but can't seem to work out a simple solution.

Thanks
Nov 6 '17 #1
1 2708
twinnyfo
3,653 Expert Mod 2GB
Neruda,

Your strWHERE variable should be a Filter, not a Query. What is the RecordSource of the popup form? Looks like it is (or should be) tblCustomers?

Also, if the Popup is supposed to produce one record for one Customer, based on the record selected from the Combo Box, then your strWHERE variable would look something like this:

Expand|Select|Wrap|Line Numbers
  1. strWHERE = "CustomerID = " & Me.cboComboBoxName
Hope this hepps!
Jan 2 '18 #2

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

Similar topics

1
by: Ray | last post by:
How can I code a VB.NET program so that it executes with a parameter input? e.g. c:\FORM1 "Param1" Thanks.
1
by: Abdul Mohsin | last post by:
is it possible to get hidden parameter values using window.opener.document.form.parameter.value. I am getting this error " Object not found" Please help Abdul
1
by: Tyson | last post by:
Hi Very novice sorry. Trying to add a simple query to a textbox...I am getting Enter Parameter Value I have a Form called (frm_tbl_RR_Datacapture). With a series of Textboxes. I am wanting...
6
by: sheree | last post by:
I would like to create a query where one of the columns of the queries comes from a combo list box on a form. For example, if my table has the following fields: id name interest1 interest2...
4
by: deko | last post by:
I'm a little nervous about slamming my database with a dozen Update queries in a loop that all modify RecordSources of open forms. Will the use of DoEvents and/or a Sleep function ameliorate any...
2
by: daralick | last post by:
I have a form with two subforms. The main form holds the Order Number and basic information. The 1st subform holds an abbreviated list of products in the order and the data source is a table...
1
by: Birderman | last post by:
HI, Any help would be appreciated. Using Access 2003 I Have a form with several buttons to drive different events that work. I want the buttons to be enabled or disabled dependent upon...
7
AccessIdiot
by: AccessIdiot | last post by:
This is driving me nuts. I have an unbound textbox (txt_SumSize) in my subform that holds the total of a field (Debitage_Size_Quantity)seen in datasheet view (control source =Sum(). I have an...
4
by: sknaina | last post by:
I have a parameter form to populate the report whose control source "Stored procedure", Form has 3 control and one click event as well as as Set on Report's Input parameter property is ...
14
by: dowlingm815 | last post by:
The following code is supposed to grab the PO Amt and group the data with the date parameters from a form. However, the coded finds no data. If the date parameter from the form is removed, the code...
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...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.