Adding Records To An Unbound Form

Sep 2, 2005

Hello, here is my problem:
I have a form to add records to my table. I cant bound it, because the controls are tick boxes, and they need to be "converted" into text to add them to my table.
I have a save button, so I can execute an insert statement with all the data I want to add to the table.
The problem is, once I have saved the record, I want to clear the form to add a new record, and I cannot use a docmd.gotorecord acnext as it is an unbound form.
Is there any way to clean a form without going control by control?
Thanks!
Cristina

View Replies


ADVERTISEMENT

Forms :: Unbound Form - Adding Records To Two Tables?

Apr 22, 2013

i have an unbound form with the following code which works as it should

Code:
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("tbl_Courses", dbOpenDynaset)
With rst
.AddNew
rst!DateCreated = DateCreated
rst!Originator = Originator

[code]....

I also need to add other text fields from the unbound form to another table but can't seem to work out how to do it.

View 6 Replies View Related

Modules & VBA :: Adding And Editing Records From Unbound Fields

Mar 4, 2015

I total novice at VBA. I am trying to code a button to modify (the last) record in a subform list and then add a new record based on values in unrelated or unbound fields on the button form.

The following code is based on the first of two YouTube tutorials (this bit on the edit) and looks like it should work. Except that my Access 2010 with Visual Basic for Aplication v7 does not recognise the type definition Database or Recordset

Code:
Private Sub ANOwner_Click()
Dim cn As Integer
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb

[Code] .....

View 6 Replies View Related

Modules & VBA :: Filter Records - Adding Unbound Date Listbox To Filter String

Feb 10, 2014

I'm trying to hash two scripts I've found into 1 functioning filter, however I'm still relatively new to vba and can't figure out how to get this working.

I'm trying to use Allen Browne's Search Criteria:

with another snippete of code I found here:

Code:
'Purpose: This module illustrates how to create a search form, _
where the user can enter as many or few criteria as they wish, _
and results are shown one per line.

[Code]....

It's the date part I'm having trouble with, the rest of the search criteria work fine without the date, but I can't get it working when I try to modify and merge the date sections of each code.

Also I'm using a listbox for the "Yesterday";"Last 4 days";"Last 9 days" and not a combo box.

View 2 Replies View Related

Navigating Records On Unbound Form With VBA

Jul 1, 2013

I have a form that reads records from a query.. It loads the first record into the form, without issue.

Code:
Sub FormLoaded()
Dim r As DAO.Recordset
Set r = CurrentDb.OpenRecordset("Results") ' Query we want
Forms("frmmainnew").lbladdUser1bad.Visible = False

[Code] ....

Now I have have 2 buttons at the bottom of the form, one for next record and another for previous record...

Code for next record

Sub NextRecordbtn()
Dim r As DAO.Recordset
Set r = CurrentDb.OpenRecordset("Results") ' Query we want
r.MoveNext
If r.EOF = True Then

[Code] ....

I know that I have 3 records that result in the query named "Results", the next record button will bring the form from record 1, to record 2... however it will not move from the 2nd to the 3rd record...

View 14 Replies View Related

General :: Updating Records From Unbound Form

Jul 24, 2012

i have developed an access database and working on interface through forms & reports .i needed that a user must have to click save button to update the data and i have found that without an unbound control its hard to achieve functionality .so i want to know step by step how to update records using unbound controls and a save button .

View 6 Replies View Related

Forms :: Set Up Navigation Form - Search Unbound Subform Records

May 16, 2014

have set up a navigation form which contains 5 unbound subforms that are made visible or not visible thru the on click event of command buttons on the main form, the subforms have a command button with an embedded macro that searches for a record based on what has been keyed to an unbound text box on the subform, this works fine when the sub forms are opened independently of the navigation form but when the search is done from within the main form, the error message is, "....cannot find the referenced from frmAQIFAList" subform, I tried referencing the main form name infront of the subform name but this also doesn't work, perhaps this would be better with code ? or is it because the subforms are unbound ?

View 4 Replies View Related

Modules & VBA :: Unbound Subform Has No (null) Records - Form Stays Blank

Aug 4, 2015

The unbound Parent form has a listbox (SQL Server) , the selection updates the SubForm with a primary key ID. The Subform is a ReadOnly view from an Oracle Linked table. It populates with a Select * From Oracleview where ID = listboxID The code is at the link shown below update: The subform uses textboxes linked to the read-only record.

The main form can populate, no problem. However the SubForm data source is either populated OR is Null.

If it is Null, the subform stays blank. Two Objectives:

1. Set a boolean variable flag in the parent (main form) that subform record exist or that it is null. e.g. Parent obtain recordset count property from Sub form
2. Display the subform with blanks.

[URL]

View 3 Replies View Related

Adding New Row To Unbound Subform.

Jul 13, 2006

A couple of questions about an unbound subform.....

1) I have an "Add New" form with a large number of controls. It has an unbound subform with two columns (a person's name and their role - both combo boxes). It's unbound because I don't want to save the data until they save the new main record.

With the unbound subform, I get one blank row. When I add data to both controls, I don't get a new blank row to allow me to enter another. I've tried adding a "New Contributor" button with this in the event:

Me.[Contributor Subform].SetFocus
DoCmd.GoToRecord , , acNewRec

It sets the focus properly, but doesn't add a new row.

Recordset type is Dynaset.
Allow edit, deletion and addition are set to yes.

Any ideas?

2) I'll be getting the entered data and saving it with a SQL insert statement. What is the syntax to reference a particular control in a particular row?

Since I only have one row currently, I'm able to get it this way:

Me.[Contributor Subform].Controls![contributor]

Once the first question in this post is solved, I hope to have muliple rows. How do I reference them?

Thanks!

View 3 Replies View Related

Adding Records Through A Form

Aug 31, 2005

I have a number of tables all with there corresponding forms. I am needing to have a command button on the form for the user to easily add a new record. Obviously this is easy by just using the wizard but my problem is that I need the record to be added over all the tables.

This is an attendance database with tables for each month. So when a new member of staff joins and there record is added for that particular month I would like it to be added to all subsequent tables as well. Is there a way of doing this. It would also be beneficial if a similar thing could be done for deleting staff (i.e. a staff member is deleted from one table and subsequently is removed from the other tables)

Any help with this would be greatly appreciated

View 4 Replies View Related

Adding Records Via A Form

Aug 31, 2005

I have set up an attendance database with tables for each month. Each of these tables has its corresponding form. I want to be able to add a command button onto the forms to add a new record. Obviously this is easily done using the wizard but my problem is I want it to be added over a number of tables.

For instance when a new member of staff arrives and is added to the database I want there record to be added over all the subsequent tables not just the one attached to the current form. It would also be beneficial if I could do the same for deleting staff (ie someone leaves they are deleted off the current table and all other tables)

Is there a way of doing this.

Any help would be greatly appreciated

View 7 Replies View Related

Form Not Adding Records

Mar 28, 2006

Hey everyone... got a little problem, i have the followinf form/subform setup show in the screenshot below, for ages the calendar conrol there has worked fine, its control source is the date field on the left habd side.

Now however, it doesnt work, or rather it works when your editing old records, it changes the dates fine, but when you go to enter a new record in, you cannot use the calendar, it just makes the windows error sound at me. And i cant type the date in either, and i cant type into any of the other fields either, but i can edit the old ones fine....

Of course i can just go into the original table that the form runs off and type new data in there, but thats not the point, i need to be able to use this form. It worked before, but i opened it today and its screwed sideways, lol

any help from anyon would be great, dragon

PIC:
http://img381.imageshack.us/img381/8988/accesserror3oc.jpg

View 6 Replies View Related

Adding Records To A Table From A Form

Apr 11, 2006

I am new to Access and have the following problem. I have one table which displays Skills (memo field) a second table which displays a skill rating ( 5 choices) and a third table which list the jobs in the company. I need to compile a fourth table which lists the skills required for each job and the corresponding ratings. I would like to have a Form in which I select the job and all 560 skills are displayed in datasheet format and I can select the ones required and allocate a skill rating. The results should then be saved to the new Table.

Any ideas as to how to acheive this task.

View 2 Replies View Related

Adding Records To Filtered Form.

Nov 1, 2005

Ok heres the problem, i seem to have a little bit of a mind block at the moment so help would be greratly appreciated.

Basically there are two tables involved, tblBikes (which contains all information on the bikes) and tblHires (which contains all the information about hired bikes) these are linked with a one to many relationship as each bike can be hired out many times.
I have a button on a form containing bike information which opens the hires form filtered by the bike ID of the record selected in the first form. When I add a record to the hires form i need the bikeID to be automatically input into the field.

View 14 Replies View Related

Adding Records To Table From Other Form

Oct 12, 2006

I have a form "release_details" having fields date, version, cksum ,comments,labels, and is link to a table,
it has a button "mai"l ,on clicking this button a new form is open which has a button "send mail" on clicking this a mail is sent and pops a message "mail sent".I need when "send mail" is click it should also save the fields of form
"release_details" to the table.


cmdSend_Click()
Forms!Enter_Release_details.Dirty = False

View 3 Replies View Related

Forms :: Why Form Adding Records On Its Own

Apr 10, 2015

I start with a table of UserIDs, names and roles (tblUserIDList). I have a simple query off that which lists them in alpha order by UserID. Next I have a simple form with a combo box which uses that query to select the User and binds the UserID field to use.

There is a button which triggers a macro which opens the 2nd form using a query which filters using that UserID. There is another point in that form in which that UserID is again used as a filter for other data. The 2nd form is a data input form. All works fine up to that point.

However, when the 2 forms are closed, for some reason the UserID is re-added to the tblUserIDList. I've never had this happen before.

View 7 Replies View Related

Forms :: Adding Two Unbound Textbox Date Pickers?

May 8, 2014

I'm using Access 2007 and building a form with controls that will be used to query one of the tables in my database. To pull back results from this table between two dates I have used the "Add Fields" method to drag and drop two textbox date pickers onto the form from the list of available fields. Both of these controls are bound to the same date field in the underlying table.

Will this cause problems when a user attempts to select two different dates on the form? Will a date on the first control be mirrored on the second control and vice versa? Should I remove these bound controls and add two unbound textbox date pickers in their place?

I also need to ensure that the date selected on the second control is the same or later than that on the first.

View 9 Replies View Related

Save Function For Adding New Records In A Form

Nov 24, 2006

Hi guys and girls,

I'm fairly new to Access and I'd appreciate some help. I've built a form with buttons to open new forms for that specific record (based on queries as all the data is held in a single table). This works fine until I try to add new records. At the moment the only way I can make this work is to add the new record, shut the original form before re-opening it and proceeding on to the other sections (via the buttons I mentioned).

If anyone could tell me how to get Access to save the record before it opens the other forms I'd really appreciate it.

Cheers,
Franny.

View 2 Replies View Related

Adding Records To Multiple Tables Using One Form

Sep 20, 2004

OK I'm totally lost again.

What I want to do is;

Use one form to add records into several tables.

I have seperated my data into seperate tables and set up one to many relationships.

tblincident
--------------
Key#
Report#
Time
Date
Location

tblPerson
----------------
Key#
Last Name
First Name
Middle Name
Address
etc.

tblItem
----------------
Key#
Make
Model
Serial#
etc.

What i want to do is use one form to enter all this data into the different tables.

There can only be one record in tblIncident that can match multiple records in the other tables.

i.e. for each record in tblIncident, I want to be able to have the capability to have as many persons related to that incident as I need.

I was thinking about setting up a tabctl for the data that has to be entered for tblIncident and then change the property setting for it to go away and then have the next tabctl appear in it's place for entering data into the next table. The problem I am having is that apparently I can only have one table as the control source for the form.

So next I tried using subforms, but that isn't working either. I can't figure out how to make the subform appear in a specific place on my form, sized in specific dimensions I want where I want.

I am just starting to learn about this relationships stuff and it's kind of difficult. How do you make it where you can do this from one form? Do I need to make a query of some sort?

Any help is appreciated.

View 1 Replies View Related

Adding Multiple Records For A Field In A Form

Nov 18, 2004

Hi forum, I have this database with a main form and 5 subfoms. For the Address Subform, I need to add multiple addresses for each person I add. How we currently do it is enter the multiple addresses per person, one at a time. Is there an easier way to do this.

For eg: Id Last Name First Name

Then Address 1
Address 2
Address 3

View 1 Replies View Related

Modules & VBA :: Updating Or Adding Records To Form - Find MAX Of Number Portion

Jun 28, 2013

I want whenever I'm updating or adding records to my form, the ID automatically take the value of the previous ID and increment it by 1.

The field type is text (mixed with number) - PM0000000.

I've done some research, what I understand is that I need to:

-do a lookup and
-find the MAX of the number portion.

Name of form - Payment
Name of table - Payment
Name of field - payment_id

I tried these, but to no avail...

Private Sub payment_id_Click()
payment_id = DLookup(("[payment_id]", "Payment", "[payment_id]=Forms![Payment]![payment_id]-1")payment_id + 1)
End Sub

[Code] .....

View 8 Replies View Related

Forms :: Adding Multiple Records To A Table Using Main Form And Not A Subform

Sep 12, 2013

I have an existing Main form that has a sub form that the user uses to enter multiple records into a table....it works fine EXCEPT that I need to make it even easier and more intuitive and add a lot of labels. Basically the user selects items from a drop down list that adds items to a Work Order. I need to add some labels to the form to make it more descriptive for the user.

So, what I want to add multiple records using a single main form.

Is is possible to?:

1. simply turn the subform into a single main form? Can this be done by using a Command button or something similar?

2. copy all of the controls etc from the sub form into a new main form and have it all work nicely?

View 2 Replies View Related

List Box Unbound Records

Aug 18, 2015

I have an unbound listbox and some unbound text boxes.I am attempting to create code that will fill in the text boxes depending on which record I select within the list box.The listbox does not have multi select on, only single select is possible.I found listBox.Value which gives me the primary key which is nice, its something.

I have attempted several ways of things I have found online with no luck on how to get the remaining information into the other text boxes.I have seen a for loop to find the one that is selected then using the listboxControl.Column(intColumn,intRow) but I obviously don't understand how to implement it.The other option is to use a query but I am apparently doing that incorrect as well.The query:

Code:
"SELECT [Student].[firstName] WHERE [Student].[SSID] = studentList.Value;"
I think this is the correct query but I cant seem to implement it either.

I know you don't want people saying "tell me how to do it." So if you have any resources I am good reading up further on it, I just cant find a place that I can get the required info.

View 4 Replies View Related

Selecting Records From Unbound Box

Jul 30, 2012

I am using an unbound box on the top of a form where I would like to select a clients name and have the form populate with their info. My problem is that the box will pull up the record by last name, but only pull up the first record with that last name in alphabetical order.

Example, If I have the following names in my database

Ben Smith
John Smith
Tim Smith

If I select "john smith" from the drop down "ben smith" will show up, if I select "tim smith" "ben smith" will still show up. If I select "ben smith" the correct record would show up.

An image of the property sheet is attached ....

View 6 Replies View Related

Selecting Certain Records To Display In An Unbound Combo Box

Sep 15, 2005

Ok sorry to be a pain :D

I have a main form frmProperty from where you can go via a button to frmTraining and these two are linked by "Property Code".

On frmTraining i have an unbound combobox which gets it data from the tblTraining table. I want this to only display data for the "Property Code" that the frmProperty is pointing to.

I assumed this would just work if the link criteria was present in the button code, however it appears that no matter what the "Property Code" the combo box displays all the data in the tblTraining table.

Anybody have any ideas?

Many thanks

View 1 Replies View Related

Unbound Checkbox To Edit Selected Records

Dec 8, 2006

Hi i have a shared database and have a form with a string of records. Each record has its own unbound checkbox and I want to make it so you can select multiple records, then be able to hit a button on the top of the form to edit certain fields of the records selected. Please keep in mind that this is shared by 10 users, therefore a linked yes/no field would cause problems between the users.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved