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

Mental block - text box binding and queries

This is such a simple problem. I've asked for, and gotten, help with this in
the past, and I can't make this work. Once more, please -

I want to be able to put a member number (which is the primary key of a
table called tblMemberInfo) into a text box on an unbound form and get back,
in some other text boxes, other information (name, e-mail address and date
of birth, say) from the same table. I also want to get, from a table called
tblMembershipInfo, the membership expiration date. I used the QBE pane to
construct the following SQL, and it does return the information I want. It
runs as a parameter query -

SELECT tblMemberInfo.fldMemNum, tblMemberInfo.fldLastName,
tblMemberInfo.fldFirstName, tblMemberInfo.fldEMailAddy,
Max(tblMembershipInfo.fldExpDate) AS MaxOffldExpDate

FROM tblMemberInfo INNER JOIN tblMembershipInfo ON
tblMemberInfo.fldMemNum = tblMembershipInfo.fldMemNum

GROUP BY tblMemberInfo.fldMemNum, tblMemberInfo.fldLastName,
tblMemberInfo.fldFirstName, tblMemberInfo.fldEMailAddy

HAVING
(((tblMemberInfo.fldMemNum)=[Forms]![GuestAdmin]![txtFindThisMember].[text])
);

However, I cannot get the information that is returned from the query to
come back in text boxes - I can't bind them to the query. I've been told
that this is possible, but I'm overlooking something.

I am using an unbound form because if I bind the form to the query, I get
the request for the Member Number in the form of a parameter request. If I
bind the form to the table, I get all the records.

I would like to have the form open, show the blank text boxes and with the
cursor in the text box where the user can enter the member number of the
person whose information is to be returned.

This is the kind of request that databases handle - information about a
particular person, who is identified to the DB with a member number, an
employee number, a whatever number. So this must be possible.

I want to use text boxes for the returned information because I think they
look better on the form. Is that the problem? Will I have to use a combo box
or a list box, even though only one record will be returned for any given
request?

Any and all help, as always, will be much appreciated.
Steve E.

Nov 13 '05 #1
1 2140
Bind your form to a query that either returns all the records, not a query
that refers to a form control. In the Header of the Form, place a Combo Box
and use the option on the Combo Box wizard to look up a particular record.
You could require that the user type in the member number in a text box and
use similar code, but there would be no check that the member number
actually exists (which you would have with the combo box, and limit to
list), and it wouldn't be nearly so user-friendly.

If you want to modify the code just a bit, you could bind the Form to a
Query that just brings back one (arbitrary) record with a TOP 1 query, and
use the entered value to modify the SQL that is the Form's RecordSource and
replace it. This would be my choice if the table(s) are large, because it
would be more efficient.

Unbound forms are rarely the best approach for handling _data_. They are
fine for switchboards, selection forms, etc., but usually bound forms work
better for handling data.

Larry Linson
Microsoft Access MVP

"Serious_Practitioner" wrote
I want to be able to put a member number
(which is the primary key of a table called
tblMemberInfo) into a text box on an unbound
form and get back, in some other text boxes,
other information (name, e-mail address and date
of birth, say) from the same table. I also want to
get, from a table called tblMembershipInfo, the
membership expiration date. However, I cannot get the information that
is returned from the query to come back in
text boxes - I can't bind them to the query.
I've been told that this is possible, but I'm
overlooking something.

I am using an unbound form because if I
bind the form to the query, I get the request
for the Member Number in the form of a
parameter request. If I bind the form to the
table, I get all the records.

I would like to have the form open, show the blank text boxes and with the
cursor in the text box where the user can enter the member number of the
person whose information is to be returned.

This is the kind of request that databases handle - information about a
particular person, who is identified to the DB with a member number, an
employee number, a whatever number. So this must be possible.

I want to use text boxes for the returned information because I think they
look better on the form. Is that the problem? Will I have to use a combo box or a list box, even though only one record will be returned for any given
request?

Any and all help, as always, will be much appreciated.
Steve E.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Cliff Roman | last post by:
I have been trying to find the answer on the postnuke forums and I have even tried Sitepoint but I am unable to find an answer. So now I am asking here in hopes that someone may have an idea ...
1
by: jlocc | last post by:
Hi!! I am working on a school project and I decided to use PythonCard and wxPython for my GUI development. I need a password window that will block unwanted users from the system. I got the...
1
by: craig | last post by:
I am having a mental block... What is the method for determining if an oject has been instantaited in C#? Ex: Dataset d; How can I tell if d has been instantiated?
3
by: Rob Meade | last post by:
Hi all, I have a login page which has username and password fields, a login button, and 2 validation controls (one for each field) - currently I have controls to display to the summary if the...
0
by: John Crowley | last post by:
I keep running into this over and over again... I want a block server control that renders a header and footer, and child controls in between. But I don't want a templated control, for the...
3
by: z. f. | last post by:
Hi, i'm using code in my aspx page. i have data binding where i use <%# Container.DataItem("DateStart") %> i also use code that makes a loop inside a regular <% %> block how can i pass...
6
by: Lance Geeck | last post by:
I have a simple form where I am using a dataset called Client. On the data entry screen, there are name, address, city state and zip. I have the fields bound to the dataset field. (Properties...
1
by: =?Utf-8?B?Q2hyaXMgRy4=?= | last post by:
Hey all, I'm coming from the ColdFusion world and am pretty new to .Net2. My issue is, I've got a page where the content (with html formatting included) is stored in a db table field. In MS...
0
by: John | last post by:
Hi I have created a drag and drop form a single table using vs2008. I have added several queries to the table adapter in Dataset designer. Is there any way for binding source to use relevant...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.