What is the problem of this form??

ocp&mcsd

The Hitman
Local time
Today, 09:00
Joined
Jan 25, 2006
Messages
113
Hi all,

The attached file contains three tables (students, classes, and join), one query (joinquery), and two forms (hasan, and secform)......
I put a combo box in hasan form, and I want when I select the student name and press the button it take me to the secform, which contains the whole information of the selected student......

Please see the file carefully, and plz help me....
Any suggestions or solutions would be appreciated....

Thank u and sorry 4 bothering u.....

Regards,
 

Attachments

Last edited:
please see the attached.

p.s. it is smaller because i use: tools/options/compact on close.
 

Attachments

Thank you very much Mr. wazz...

But can you please, explain me why did you add these two lines:

Dim stLinkCriteria As String
DoCmd.OpenForm stDocName, , , stLinkCriteria


Thank u again.......
 
Last edited:
I have attached a copy of your dbase have a look at the new form called Mart (a copy of Haan) this now works (needs tidying up but gives you an idaea of the way the form works)
 

Attachments

hi. i made the button with the 'wizard' - it was created automatically - and the code you see is standard code created when the wizard automatically creates a button. in fact, you only need
Code:
DoCmd.OpenForm "frmNew"
or
Code:
Dim stDocName As String

    stDocName = "frmNew"
    DoCmd.OpenForm stDocName
sometimes it's easier to use 'Dim' to set a variable. if you had a long form-name like frmMemberAttributes_Filtered (or something...) and if you have to refer to the name many times in the procedure, you just set it once -- stDocName = "frmMemberAttributes_Filtered" -- and every time you need it you just say, stDocName. it's just useful as code gets more and more complicated; and it's written automatically by the wizard.

p.s. you don't need LinkCriteria in this case because the form that is opened next is based on a query that has criteria already built in!
 
Thank you again Mr. wazz...

Can u plz, tell the steps of adding the button to the form (that u did), because I am a very beginner....
I have added the button using the wizard, but still by pressing this button, I have been moved to the other form but without showing the related data (empty form).....
Thank u and sory for bothering u again and again.......
 
Last edited:
- open the new form that i made (frmNew) in design view
- look at the properties of the form; click the data tab
- look at the Row Source of the form; you will see qryNew -- that is the important part
- close the form

- go to queries; find and open qryNew in design view
- you want to see the classes that someone takes so you have to look in your join table (your tables are set up fine)
- you want a person and you want a class name
- you already selected a person in your combo so that is the criteria for the 'sid'
- now you just need a class; you could put 'cid' from 'join' (which is correct) but you won't know the real name, just the id. so add the actual name from the classes table and that's it.
 
Last edited:
Thank u Mr. wazz....
And really, I am sorry for bothering you (yesterday and today).............
Bye.....


Regards,
Eng. Hasan
 

Users who are viewing this thread

Back
Top Bottom