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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Main Form,Command Buttons

Status
Not open for further replies.

Spec01

IS-IT--Management
Jul 21, 2005
73
CA
Hey,

My Database that I have been working on is a database to Keep track of Computers in the Offices. The problem that I'm having is when i go into my Main Form I have Some information about the User and the Computer. Now, I also have 2 Command Buttons that Link to 2 other Forms that go in more detail about the computer and the type of software it has. The Command Buttons are Computer Specs, and Computer Software. They both go to the correct place when you open them but, I want to set them up so that you can only go through the records by the Main form. The way it is setup now is when you click on the button it allows you too add records for Specs and also software. The reason why this is bad is when you go to the Main for and your on record 45 when you click the Specs or Software Button it starts at the first record you entered, meaning i would have to go through all of the records until i get to 45. i want it so that when i click on Record 45 in the Main for that when i click on Specs or Software it will be at 45 rather then navigating all the way too 45 satrting at the first record.

Please Help i have been trying to solve this delema for a few hours now and still haven't come to a conclusion.
 
Can you tell us how you open the form when you click on the button (assumably the docmd.openform) and what the listed arguments are? Does the main form stay open after the button is clicked to get the next form? Also, you mention that you don't want to add records into the clicked form, that's easy to setup in the form properties by setting add to false. However, you also mention that you don't want to scroll through the list, you want to have the information displayed based on the selection made from the main screen. That should be easy to setup as well providing you have the datta elements in the table to select. Do you have fields in the db that uniquely identify each PC?

Lamar
 
Yes i do have a Unique ID - Computer ID

The Computer ID is in Both the Main Form and the Computer Software Form and the Computer Specs Form.

This is the Clicking Code that is displayed for Computer Specs:

Private Sub Computer_Specs_Click()
On Error GoTo Err_Computer_Specs_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Computer Specs"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Computer_Specs_Click:
Exit Sub

Err_Computer_Specs_Click:
MsgBox Err.Description
Resume Exit_Computer_Specs_Click

End Sub
 
Also the Main Form Does Stay open when i click on the Specs Button.
 
The weird thing is that, when i make a Subform right on the Main Form it works the way that i want it to, but, it doesn't work when I try and do it by the Command Button Which is Specs Button
 
Does Anyone have any ideas Please Help
 
How are ya Spec01 . . . . .

In the code for each button, copy/paste the line in [purple]purple[/purple] where you see it:
Code:
[blue]    stDocName = "FormName"
    [purple][b]stLinkCriteria = "[ComputerID] = " & Me!ComputerID[/b][/purple]
    DoCmd.OpenForm stDocName, , , stLinkCriteria[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top