Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

building a serch field into a form

Status
Not open for further replies.

defosset

Programmer
Apr 1, 2003
48
0
0
US
I want to set up a field in my form that wehn you enter the donor ID Number it pulls up the doners first and last name and in a sub form it pulls up the payment history.
there needs to be blank fields in the
regular form to enter a new payment and date the payment was posted(needs to read computer date) and it also neds to read the id number so the only thing the user needs to enter is the amount paid. the fields that will be the entry fields are also displaying the previous payments in the sub form.

thanks
nick
 
Have a look at this thread. It might start to answer your question!
thread702-457928
 
i dont think this answers my question because it done not look like the material he search for is putinto a subform on the form, he actially wants it put into a web page form, ball i want is a sub form

thanks
nick
 
Can you give me more information on your database like what tables or queries you have and what information you want in the subform.
this can be done but I would have to know exactly how your databse is set up and how you want your form and sub form set up.
 
yes this is how my database is set up

table 1 - Doners table 2 - Pledge Data Table 3 - Payment
History
Doner ID Doner ID Doner ID
First Name Gift Type Date Received
Last Name Amount Pledged Amount Received
Address Amount Received
City Amount Past Due
State
Zip Code
Phone Number
E-mail
E-mail Update
Time Period

what i want to do is when you open the form the doner ID is blank you put in the doner ID and click a button and it pulls up info and displays the first name, last name, and zip code. also in the form there should another doner ID field, date field(date field need to read the computer date) and amount recieved fields, this is from payment history table(this is where you will enter the payment you want to post to the payments history table, there will be a a subform it will show previous payments from the payments history. when I set up the form orginally the last known pay ment was showing up in the subform and it was also showing up in the fields where the new payment info needs to be inputted.
 
Another good source is the Northwind.mdb on your computer Hope this helps
Hymn
 
Okay
First of sorry for taking so long I got stuck with a project at work that took me a lot longer than I thought.

Well I tried to stick to your instructions

I created three tables with the information below

table 1 - Doners table 2 - Pledge Data Table 3 - Payment
History
Doner ID Doner ID Doner ID
First Name Gift Type Date Received
Last Name Amount Pledged Amount Received
Address Amount Received
City Amount Past Due
State
Zip Code
Phone Number
E-mail
E-mail Update
Time Period


I then went to the "tools" menu and clicked on "relationships" and created a relationship between the three tables.

I then created a query named "qryDoners"

I inputed two of the three table the "Doner's Table" and the "Pledge Data" table
in the query I took the "DonorID field,FirstName, LastName, and ZipCode Field" from the "Doner's Table" and I took the "AmountReceived" field from the "PledgeData" Table.

I then created a form called frmDoners it had "qryDoners" for the recordsource

in the header I created
an unbound textbox named txtSearch a command button named cmdSearch and another textbox name txtDate in the txtdate the control source ="DATE()" that will give you today's date.

in the "Details" section you proceed to enter in the fields that were set up in the query that you created. In the Footer you create a subform and in the subform controlsource you choose "table.PledgeData" that will allow you to look up the "PledgeData" table.

Now in the cmdSearch Command Button you enter the following code in the onClick event.


Private Sub cmdSearch_Click()
Me.RecordSource = "SELECT * " & " FROM qryDoners " & " Where qryDoners.DonerID LIKE '*" & txtSearch & "*';"
End Sub



Now when you enter the DonerID in the txtsearch field and you press enter on the cmdSearch Button you should get the DonerID that you are looking for.

 
I am getting errors when i click the search button also I cannot get the date to apprear the ="DATE()" appears.

here is my search sting

Option Compare Database
Option Explicit

Private Sub cmdSearch_Click()
Me.RecordSource = "SELECT * " & " FROM qryDoners " & " Where qryDoners.DonerID LIKE '*" & txtSearch & "*';"
End Sub

the error is object does not support this object or method
runtime error 438

do you want me to send you a copy of my DB.
 
in the =date() do not surround it with "" I just used that to make it distinguished sorry about that


Check to make sure everything is named correctly it sounds like tou may of missed spelled something in your database. If you want you can send a copy of your database to at51178@hotmail.com and I will take a look at it.
 
your e-mail is incorrect and i have tried to send my db to you

thanks
nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top