Sorry if this is the wrong area to post..

Throx1

New member
Local time
Today, 09:46
Joined
May 16, 2008
Messages
3
I have a gui built in Access (atached) but I also ave a button at the end that says add record. How can I get that button to actually add the fields that were entered by my coworkers to the table? I also need that data to go to the database that will be located on a network drive. I have 2003 at work but 07 at home. Will that be a problem? Any advice would be greatly appreciated. Thanks in advance
 

Attachments

  • Image1.jpg
    Image1.jpg
    42.6 KB · Views: 145
i think it is unbound for the fact that i have 0's in the form field and when I delete the o to leave blank it automatically puts in the unbound word
 
Not sure you understand the question. A bound form is one that is 'attached' to a table or query. When you enter data in the form, it is reflected immediately in the relevant table. An unbound form is one that has no connection to the table where data is stored, and VBA code is used to transfer the data.

If the form is bound, then there is no need to have an Add Record button. The data is saved automatically when you close the form or move to the next record.
 
gotcha....I have a table as well but the funny thing is it is mot updated immediately......their is no VB behind the button but I like your idea of just basically eing bounded.....how can I bound a form?
 
Open the form in design view.
Open the form properties sheet. Set the Record Source property on the Data tab to your table or query.
Open the properties sheet for each control. Set the Control Source property to the relevant field from the drop down.
Save the form.
 
Are your form fields connected to a table or query? If not add an SQL statement to the button. Turn your form into design mode, right click on the button and select build event and paste your sql. something like this:

Dim strSQL1 As String
strSQL1 = "INSERT INTO Person (FirstName, Surname,) VALUES ('" & Me.txtFirstname & "', '" & Me.txtSurname & "');"
DoCmd.RunSQL strSQL1

This will data to your table.
 
The picture shows that it is currently a bound form. The field names would not show in the controls in design view if they weren't.
 

Users who are viewing this thread

Back
Top Bottom