finding vlaue in table using serach button

tina hayes

Registered User.
Local time
Today, 12:53
Joined
Jul 28, 2004
Messages
37
i have a page on a main form on this form there is many textfields all stored in
the same table. a set of textfirldswere named telenumber 1 through to 8, thesetexfields are linked to hundreds of friends, and i wanted to beable to put a searchfacility in so that i could serach for the telephhone number of a friend. and it would opulate the the other textfields on the main form. i was thinking that if a have a Command button named search and when you clicked it it opened up with a new form.

On the form had the same textfields telenumber 1through to 8. if i entered the number in to one of those fields and i would have a command button that would be named something like continue.

i know that the coding should go something like this but how i am not sure

sub on_click continue button
selected the field that has a value "not NUll" (the one out of the 8)
Find vaule in table
Populate main form

could someone help me with the actual coding please or am i just making
things far to complicated than needed.

i hope i have explained things well enough for you all to understand what i am trying to do
you help would be much appreciated
 
I think you may need to explain your table structure a little more. Are telenumber 1-8 all within the same record in your table. Is ALL of the data in the same table.

Are you saying that only one of these 8 fields will have a value (not null) in each record and you want to find which one it is?

I don't follow exactly what you need to do here.

More information please...
 
more explanantion sorry

I have a main form, on this form there is five pages but all information on these pages is saved in the main form table.

The page i am talking about: to simplise things
it has a lot of text boxes on which are all connected to the same one main table. There is 8 lines, each line has three boxes, these are called first name, second name and telephone number 1 - 8. each of these text boxes are bound to a field in the table called telephone 1 telephone 2 telephone 3 etc. .

on this page there is also a search command button which opens a new form
on this form is has 8 boxes telephone 1 telephone 2 telephone 3. etc also a continue button. what i would want it to do is if i enter a telelphone number into the telephone 2 box (only leaving the others blank) then click the continue button, for it to look at the telephone 2 field in the table find the telephone number then diusplay the information regarding the name and second name which is also stored int he same table.

i hope this makes sense if not i will make up some screen shots to help with the process

can anyone help :confused:
 
The page i am talking about: to simplise things
it has a lot of text boxes on which are all connected to the same one main table. There is 8 lines, each line has three boxes, these are called first name, second name and telephone number 1 - 8. each of these text boxes are bound to a field in the table called telephone 1 telephone 2 telephone 3 etc. .

try to normalise your data before you proceed. Having 8 telephone fields in a table is really not the right way to do it !

search the forum for normalisation to get a better overview of what i mean.
 
sorry

i am sorry, i didn't mean for it to be taken as stone, i was just trying to make life a little simplier to explain.

i dont actually have eight lines name telephone phone but i was struggling to explain what i meant with all the typing of different names for text boxes each line is different holding different information.

i was trying to make life easier for me and putting all seraches on one form to save having a serch button for each line.

all i want is some code to put behind the continue button that basically says

check the textboxes on the form to see which one is not null

find information main table

display information on page on form

does this help :o :o :o
 
in some more detail

i have page and on it it holds a number of text boxes. each secxtion has three texboxes, named date removed, requested by and reference number.

this certain book can be requested four times

so there is four sets of text boxes for requested.

then there is the returned textboxes for these allow you to see that they have come back in.

there is a serach button o this form which allows me to open another form so i can serach for specific reference numbers from

the form would have two texboxes one for sent one for returned.

if i put a figure in one it woulds need to check all four sent column s ithe table until it found it and then displauy the message on the main form.

can any one give assistance this is really doing my head in now i can't hink of an easy way to do it

other than using a combo box would that work maybe ????????
 
tina hayes said:
this certain book can be requested four times

so there is four sets of text boxes for requested.

Eliminate that repeating group and make a new table for requests - to get any sort of result from your database you'll need to work on your table structure as it currently doesn't meet First Normal Form (1NF).

Also, it's a better practice not to have spaces in the names of your controls and to prefix them with a three letter code so that you can identify them easier.

i.e.

txtDateRemoved
txtRequestedBy
txtReferenceNumber
 
Last edited:
normalisation complete hopefully

so
i have added a subform onthe page and set up a new table in the DB for it
i have normalise oall the naming conventions so hopefully on that side of things everything should be working properly.

but i still now have the problem regarding the code behind the search button.

any ideas, the coding has stumped me
 
the find facility

i found the Micorsoft find facility and but a find button on my form.

i thought that it would look through all the tables and return the value that you searched for, but it doesnt matter what you put in there is always comes back with the same answer that it can't find the value you are looking for.

i am a complete dead heat with this
i cannot make head nor tail of it
could some one please shead some light,

i will have to go back to trying to program a search button but that has stumped me too

please help
 
has anyone any ideas

i am begiinig to pull my hair out about this problem

but i am one of these people that can't give up

please help
 

Users who are viewing this thread

Back
Top Bottom