#  Other Applications & Softwares  > Access Tables & Databases >  >  Linking two forms in Access without using a subform

## TomNSD

I want to link a form to another form without making the form a subform.  I have three forms; a "main" form, a "mainsub" form, and a "project" form.  I am trying to create a button on the "mainsub" form that will open the "project" form to a specific record.  The common field in both forms is "projectid".  This is the form field name and not the underlying table field name.  I wrote this code, but it didn't work.  




```
Please Login or Register  to view this content.
```

----------


## alansidman

If ProjectID is a string value, then you will need to surround it in quotes




```
Please Login or Register  to view this content.
```


BTW:  forms don't have fields in Access.  They have controls.  Fields are located in tables.  For future reference to avoid confusion.  :Smilie:

----------


## TomNSD

Thanks for the response.  When I use this code a box opens and says "enter parameter value".  Does it make a difference that the control Name is different from the control source name?  I did this because the control source name was "IT Project ID" and I thought the spaces might interfere with the code.

----------


## alansidman

That should not be an issue.  I often name the controls differently from the fields.  Perhaps you should upload your db with sample data (sanitize for confidential material).  Make sure to run a compact and repair before uploading.

Alan

----------


## TomNSD

Alan,
Thanks for looking at this.  Attached is the database.  If you open the main form you will see the buttons next to the records that the code. 
Tom

----------


## alansidman

Ok. I think the issue is that you have a subform inside the main form.  This means that you need to identify the control in the subform using the syntax shown here:  http://support.microsoft.com/kb/209099

Alan

----------

