Help with forms

cdcox

Registered User.
Local time
Yesterday, 22:20
Joined
Aug 29, 2005
Messages
21
A coworker and myself are creating a db for work. We have created our table and a forn, but would like to just create a forn with just one item in it so that when someone types in their entry that it would open the second form with all the data.

Any assitance would be appreciated.
 
Are you just looking to give the end user an easy way to get the data displayed?
You can create a main form with a subform, and link the two so that the subform displays the data of the selected record on the main form.
Easier yet, Have one form with all of the fields on it, and add a combo box, when prompted, select the option FIND A RECORD ON MY FORM BASED ON THE VALUE I SELECTED IN MY COMBO BOX. If you use the main field in the combo box, the rest of the form will fill itself out with the related data.

EXAMPLE: You have a database containing info on people and their contact info. Place all of the fields on the form, and then add the combo box. When prompted, select the option mentioned earlier, and use the field containing thier name for the combo box. When the user makes the selection of the name in the combo box, the other fields will display the persons data.
 
Thanks, Jeremie

I have tried what you suggested but am still not getting requested results.

What we are trying to do is say on one form that the only entry there is to enter the Site ID, when this info is submitted that on the second form it will display all data that we have entered on the first form.

Ex: Enter site ID:

Once this is entered all pertinent data will appear on a second form.

You had mentioned also about linking a main form with a subform - I don't know how to do that. As when I tried to create a subform onto our main form all data is shown for both forms. Don't know how to just bring up the intitial form for the single entry and then link to the data form.

Any assistance/advice is greatly appreciated.
 
Last edited:
Is the data stored in multiple tables?

tblSite
~SiteID
~SiteName
~Address

tblSiteData
~SiteID
~SiteData1
~SiteData2
~SiteData3

I will throw together a small example of a subform for you, but the table structure should be as normalized as possible.
 
Example

I have attached a small example. What I have here are tables with an established relationship. I create the main form from the tblSite and the subform from the tblSiteData. I also added the drop down combo box record selection to it for demonstration. This was simply done using the wizars that MS provided.

Let me know if this is any assistance or not. If you were to give a better description of what you are working with (tables and structure rather than data), I might be ale to help more.
 

Attachments

Last edited:
Hi Jeremie,

attached is what we have on form 1, what we want to do is create another form or whatever it takes so that it will only have one item - that being Site ID, so that when you enter the 6 digit number it will bring up all the data on the first form.

Again, thanks for your help.
 

Attachments

Ok, first off what i see is the form design itself. It is a bit cumbersom and could be laid out better. I took your basics and added them to a form that contains a tab controll. Secondly, I based the form off of a parameter query that will prompt the user to enter the site ID. The last item I changed was adding a button to allow the user to change the site that is displayed. The button simply has one command behind it, me.requery.

Look at what I have here and let me know if it is of any help.
 

Attachments

Assistance inputting table data

Jeremie--
My name is Brady and I am working with the guy who has been posting. What you did is really awesome and I'm at the point that I want to learn this more in-depth. The problem is that we still can not input any table data and have it post in the field list. There is still much more that we want to add to it, but can't get it to post to the table. Is there any chance you would mind chatting over the phone for a few minutes? We can call you--that would not be a problem. Any and all help would be greatly appreciated, and we certainly do appreciate what you've provided us thus far. Thanks in advance.

Brady
 
Please forgive my hesitance in giving out any personal information such as a phone number. It is my experience in the past the all questions are best left within the forum. I have no problem helping you achieve what you are try to do, but I must insist that it be done via these forums.

Sorry
 
Hey Jeremie,

First of all I want to thank you very much for all your help, this has been an experience for me and my coworker.

New questions:

Reference Switchboard: we figured out out to make the menu buttons, such as going directly to the database on Form1 asking site id, then we added a second to exit the program - as far as exiting the program we want to close Access completely, but when we click on this exit button, it will only close the database, leaving Access still open.

Second question is and I really don't know how to phrase it is this on the form. We have created an Option Group under the tabbed Group (IP Info and Configs) Config Control Panel - not sure is this is the way to go - but what we want to do is when we click on the various Cisco equipment is eith copy/paste config info into the Config Window and have it save for each piece of equipment that there is information for.

I am sending a print screen of the db in zip format for your review - and once again we greatly appreciate your help and assistance on this.
 

Attachments

"as far as exiting the program we want to close Access completely, but when we click on this exit button, it will only close the database, leaving Access still open"
Make sure the event behind the button is DoCmd.Quit and not something else.

For the option group to change the display on the text area, you need to code the after update function of the frame. Say the frame that has the option group is frame9. Selecting the first option in the fram will display "bananas" in the textbox (text20). Once you select the the second option, "apples" will apear ~ replacing "bananas".

Private Sub Frame9_AfterUpdate()
With Me
If .Frame9.Value = 1 Then
.Text20.Value = "bananas"
End If
If .Frame9.Value = 2 Then
.Text20.Value = "apples"
End If
End With
End Sub

The "With Me" in the first line of code allows you to simply skip placing the me or form name in line before the . preceding the object. Without the "With ME" statement the code looks like this.

Private Sub Frame9_AfterUpdate()
If me.Frame9.Value = 1 Then
me.Text20.Value = "bananas"
End If
If me.Frame9.Value = 2 Then
me.Text20.Value = "apples"
End If
End With
End Sub


I prefer using the "With Me" in arrays and repetitive If statements.

Let me know if this helps,
Jeremie
 
not sure what the code is trying to do...

Hello again Jeremie--

I believe what you were trying to accomplish with the option group code is to display a particular text string as each option is pressed. While that is true, what we want to accomplish is to have the user input data and be able to click on each individual piece of equipment listed in the config control panel, copy and paste the configurations, then save it. That way when we go back to view the data, all we have to do is click on each piece of equipment to get the configs to display in the memo block. I hope that makes sense to you. In essence, we are trying to avoid putting in a command button that links to a notepad document with these configs and just have it all local to the form. We want to ensure that any changes to the configuration data will be editable after clicking on that particular piece of equipment in the option group.

What do you suggest? Are we going about this in the right way? Is this feasible with the option group tied directly to the memo box? When you initially configure the option group, it asks you what data should display and where should it link to. I just kept the default values of 1, 2, 3, etc.
 
Hi Jeremie,

I know that we are just full of questions and I do want to let you know that you are helping us out tremendously. but my other questions is this:

Instead of using the Siwtchboard come up and we or the user clicks on a button that states: Enter site ID which will then open the form to input the Site ID - is there a way that when using the Switchboard there is a fill -in window (such as your example) that the first thing that a user will see is this fill-in box to enter this ID, then after entering this ID on the Switchboard menu will take them to the data form.

I sure hope that this is clear as I am trying to visualize what I am asking.

Again, thans for your help.
 
What you are looking to do is pass the information from one form to another with a global variable.

When the click the switchboard item, have it open the form you have in mind for entering the site ID. Look in the properties under the events tab for the for the On Close event. You can then enter the code DoCmd.OpenForm and it will allow you to enter various parameters such as the WHERE option that allows you to set value assignments to variable. I WARN YOU NOW, this is my weak spot. You might be better off searching the threads for something related to passing variables, global variables, or something of that nature. You can also look into MODAL forms since they can be used for what you are referencing.

Check the VBA section of the threads as well. There are some very good people in this community that really know thier stuff.
 
Sorry, only noticed the very last reply and missed the one before it.
What you need to do is in the after update function of the frame, change out the textbox. Actually create a textbox for each of the answeres (based off of the table) and STACK them. Enable/Disable & the VISIBLE settings can make the one related to the selection the only one availible.
What I see as a problem would be relating the data back to the table. I am not exactly sure where your going with this, but I think this method should work.
 
Last edited:
Based on your last post, what we are trying to do is this:

We have 7 pieces of equipment that we develop text files for in order to configure that equipment. Each successive line is copied and pasted from the text file to that piece of equipment. What we want is a way to create a check box list or option group consisting of each piece of equipment that will allow us to click on any one of them and be able to pull up the text configuration data. What I envision is selecting a radio button for any one of them, and then be able to input multiple lines of data to the memo block, save it, and then display the configuration data in that memo block (a text block only allows 50 characters, so this would not be sufficient) whenever that particular piece of equipment is opened in the future. We are not really sure what actions/steps need to be completed or what code (if any) needs to be implemented.
 
Jeremie--
Something else we are trying to do--we want to run a ping command via a radio button or command button. We have IP addresses set up for multiple pieces of equipment, each IP address consisting of 4 different text boxes. We want to be able to launch a ping and have the program read the values from each of the 4 text boxes that make up the IP address. How can we accomplish this? Thanks so much AGAIN!
 
I think that you now require some assistance a bit above what I can offer. What you may want to do is actuall post this as a new line of questioning into the code section of the forums. Design and structure are my strong points, but when we get into the more complicated code I am not the best person to be asking. Someone of the others here in the forum are very good at this sort of thing and would most liekly be able to answer these sorts of questions.
I understand where you are going with this, I will soon test for my CCNA. You want at this point to easily generate individual router/switch configurations by using a base template and entering specific data into a form. I could only see launching launching a ping command from a BAT file, then saving the results to a txt file, then drawing the results from the txt file into the database. Like you enter/select an IP on a form and click a button, the VBA would pass a varible to the BAT file (the ip) and it would run

ping ***.***.***.*** > %systemroot%\pngre.txt

then the vba would run to extract/import the data and then delete the pngre.txt file.

Since this isnt my #1 area, this is about the best I could offer (theory).
 

Users who are viewing this thread

Back
Top Bottom