Some Basic Questions ...

G

Guest

I feel ashamed to even ask these questions, but since I need it urgently, I
have
to do so, I appreciate everyone help ...

1. I would like to accept input to a sql query.
I have a query like select * from empid where empname=<input emp name>

How do I accept <input emp name> from users?

2. I want to create a form to accept variable just like empname in a form,
but this form isn't linked to any table, I want to accept the variable from
a combo box and pass the selected value to another form which is based on
the query in 1 above.

Let me know if it isn't clear.

Thank you,
-Me
 
G

Guest

You don't really need two forms for this.
Create a form based on your query, but without the Where statement.
Put text boxes or other controls, as appropriate, on the form for all the
fields in your table.

You can now view and edit the data in your table. You can delete records
and add new records.
Don't worry about the Lookup capabilities until you get the above working
like you want. Once you have the basics down, post back, and I can help you
with how you do a lookup to find a specific record without having to use the
navigation buttons to move through the records.
 
G

Guest

Klatuu,

Actually I already have such form in place. But I am not using that form
since it has
various subforms associated with it and also there are lot of checks to be
performed.

Here is how it works, I have a main form linked with 2 subforms,
the 1st subform is associated with people who are authorized to work on
project and hence should be able to view data in the main form.

the 2nd subform contains addtional information about the project linked to
yet another table.

I already have all these in place. But when I do a search for a person in
2nd form, it shows all records(say 300) and leaves blank for records in the
2nd form for which the condition for name doesn't match.

I would like it not to display the main form completely if there isn't
anything in the 2nd subform. It should display only the records that match
the name (say 15).

Since it was becoming difficult, I decided that I will have users enter the
name of the person and then from there I will go.

Do you have suggestions?

Here is the how screen looks like ...


--------------------------------Main form -------------------------
Project No. ..
Details ....

---------1st subform begins------------------
Project Consultant Date ...

--------------------------1st subform ends here (notice its the same
screen)----
--------------------------2nd subform begins ---------------
Project Correspondence .
date xxxxxxxxxxxxxxxxxx
date xxxxxxxxxxxxxxxxxxxxx
date xxxxxxxxxxxxxxxx
---------------------------2nd subform ends here -----------
---------------------- Main form ends here------------------------------

Thank you,
-Me
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DLookup Issue 9
Combo box / Subform Question 7
List Values 1
Using Bound Control right 3
Help Plz... 4
GoTo from combo on form 3
Automatic Fill In 2
Need Help... 4

Top