If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Using forms
I just started using access for the first time and was
confused about how to use the data in the tables in forms. I'm not sure how to set up a form that can take in a parameter, such as a name, and get it to display information in a table. Can anyone help me with this? |
#2
|
|||
|
|||
Using forms
I'll take a stab. Forms are a vary versatile object. They
can either be Bound or Unbound. Bound forms are based on a table or query. By placing controls on the form that are bound to the table's fields, when you change or enter a new value in the form control, the value is stored in the table. You can do what you're after at least two ways: 1) Base a form on your table. An easy way is to use the form wizard, tell it what table and what fields you'd like to include. It will create the basic Bound form, and place the form controls bound to the fields you've selected. To display a particular record, use Filter By Form on the Form View toolbar, and enter a value to search for. 2) Another way is to provide an unbound "Selection Criteria" form. If the field you wish to match can only have certain values (like a Customer with a unique CustomerID), you can provide a combo box for your users, and a command button that opens a second form displaying the data you're after. This is the more common way for developers. The code snippet below uses the value entered in the selection criteria form, using it as filtering criteria: Private Sub YourCommandButtonName_Click() On Error GoTo YourCommandButtonNameErr__Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "NameofYourFormInQuotes" ' See VBA Help on OpenForm. This opens the form ' in Add mode. Other options are available. DoCmd.OpenForm stDocName, acNormal, , , acFormEdit, , stLinkCriteria Exit_YourCommandButtonName_Click: Exit Sub Err_YourCommandButtonName_Click: MsgBox Err.Description Resume Exit_YourCommandButtonName_Click End Sub HTH Kevin Sprinkel -----Original Message----- I just started using access for the first time and was confused about how to use the data in the tables in forms. I'm not sure how to set up a form that can take in a parameter, such as a name, and get it to display information in a table. Can anyone help me with this? . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
datasheet forms open in form mode from the Switchboard | Paul James | Using Forms | 5 | July 13th, 2004 06:51 AM |
Protected forms | Angela | General Discussion | 2 | July 8th, 2004 06:41 PM |
Data entry forms and/or subforms | Hugh Crean | Using Forms | 2 | July 8th, 2004 05:56 PM |
Word Forms? | CEVisker | New Users | 4 | June 21st, 2004 01:25 AM |
Forms Check Box not working | DLLower | General Discussion | 2 | June 17th, 2004 09:34 PM |