Modules & VBA :: How To Force Save And Maintain Integrity Of Data Input To A Form

Jun 15, 2014

I have a button that when clicked moves a piece of data to a subform. I have put the whole sequence below. The trouble I am having is :

- The event will not happen until the form is saved. I think this is because fkTaskID is a new record (auto) number which hasn't generated yet.
- If I force the form to save it does work but then I get an error on the INSERT command when not all required fields of the form are complete (see sample in second part below).

Is there a way to save the record and maintain the integrity of the form input - and still have this code work?

BUTTON CODE
==========
Private Sub BTNAddReasonRw_Click()
Dim dIndex As Long
DoCmd.SetWarnings False
For dIndex = 0 To Me.LISTReworkReasonsUnselected.ListCount - 1

[Code] ......

View Replies


ADVERTISEMENT

Force Switchboard To Maintain Window Size

Nov 16, 2006

Is there any way to force the switchboard to maintain its pop up window size? Whenever I open an item from it that is maximised and then return to the switchboard it too has maximised.

Thanks

Russell

View 4 Replies View Related

Modules & VBA :: Requery Continuous Form And Maintain Bookmark

Jul 11, 2013

I have this code:

Public Sub cmdRequery_Click()
Dim vFlag As String
vFlag = Me![EncounterNbr]
Me.Requery

With Me.Recordset
.FindFirst "[EncounterNbr] = '" & vFlag & "'"
Me.Bookmark = .Bookmark
End With

The user starts on a continous form and opens a record, makes some changes, and then when that form closes it triggers this public sub.

The code does what I want it to do in that it returns to the last encounter number that was selected (now on the continous form again) and it requeries and shows anything that was changed about the record on the form that was closed before requery.......

But it always resorts and moves it and I want it to stay in the same spot unless the user sorts. Is there any way to make that happen?

View 9 Replies View Related

General :: Maintain Stock From Daily Input-output Table

Feb 17, 2013

i have a production database in which i have different sections processing on the same product. i have a daily production entry form on which datewise entry is done for each section.

i want to maintain the total stock of each section (sectionB) with productName, input from sectionA , production from sectionB, balance (input-production) . presently i used query for this .. but i need a stock table in which entries should be inserted by an automatic query .. how should i achieve this :

1. by an append query who runs every time to append the quantity when a daily entry is made .??
2. by an update query to replace the quantity with a qty from totals query ?

i.e. what is the best method to maintain inventory from input & output tables ?

View 3 Replies View Related

Modules & VBA :: Save Input Into Array And Show This Information

Nov 23, 2013

I want to save input into an Array, and then show this information.To enter data I am using a textBox. After "Enter" it should save info into the Array.If textBox is empty, it should show information. I would like to use a textbox too, that shows all the Array after pressing Enter.

textbox on the Form: txtInput, txtOutput..I have the following code, but I am not able to get it work:

Code:

Option Compare Database
Public Sub Form_Load()
Dim Data(10) As Integer
Dim i As Integer
Dim j As Integer

[code]...

View 4 Replies View Related

Modules & VBA :: Save Data From Form To Table

Oct 24, 2013

i got a form with three normal fields where i add data i then have two auto number fields i.e. SupplierID and PersonID the supplierID works fine, i can add a new record and click save and it will save the data in the suppliers table.The problem is with my PersonID field, i need it to retrieve the data from my subform and firstly display in the field on my main form and secondly, when i click save it should save save the number that is displayed into my Suppliers table.

View 2 Replies View Related

Modules & VBA :: Save Data From Last Row Entered

Nov 13, 2014

I have a form where the user can add as many rows as he wants - it's usually only 1 or 2 but that's not the point.When he has finished editing he clicks a Save and Exit button.In here I want to save data from the last row he has entered. I have this working but only if the cursor remains on the last row or on the 'new' record row. If he manages to, say, put his cursor on the penultimate row then I save the data for that.

eg.

Col1.........Col2..........Col3..............Col4
AA...........AAA...........AAAA.............AAAAA
BB...........BBB...........BBBB.............BBBBB
CC...........CCC...........CCCC.............CCCCC
DD...........DDD.........DDDD.............DDDDD
EE...........EEE............EEEE.............EEEEE
NEW LINE

So I for instance want to save Col3 on the last line filled in. Lets say the control is called Col3 then

If the cursor is on NEW LINE I have got the code so that
Me.Col3 "EEEE"
If the cursor is on the last line (the 5th) I have got the code so that
Me.Col3 "EEEE"

If the Cursor is on the first line i get "AAAA", "BBBB" for the 2nd etc. How do I always pick up the last line?

View 4 Replies View Related

Using Access To Maintain Client Data And Generate Standardized Letters

Jul 31, 2013

I'm not sure if Access is the right program to use for this scenario as I only know the basics on creating the database.

I want to be able to create a client database and then be able to generate a number of standard template letters at any particular time for selected clients.

I don't want a mail merge!!

Can access be used for this?

Ideally I would like to create a form for administrators to use to input new client info and update existing clients info and then just be able to click a button (or the like) to generate the standardized letter for a particular scenario.

View 1 Replies View Related

Modules & VBA :: Data Not Saving To Database When Using Save Module

Oct 27, 2014

I have a back end database that a number of people are working with using an Excel add-in that imports and edits records saved in the backend. Occasionally, when a user will update a record at first it saves to the backend but then an hour or two later, the changes made disappear. We have validated that after the user saves the changes, those changes are present in the backend of the database, but for some reason those changes disappear after a period of time.

View 7 Replies View Related

Modules & VBA :: Save Subform Data To Temp Table

Jul 2, 2013

I have a MainTable with Subform. The Subform is based on a Query. I want to save the data/Fields from subform to my TempTable..

MainTable Fields:
EmployeeNo
Name
Position

TempTable Fields:
ID*
Salary
Allowance

Subform Fields:
EmployeeNO (not Shown on Query results)
Salary
Allowance

I want the fields in my subform to be saved in TempTable..

View 4 Replies View Related

How To Maintain Form Size

Mar 9, 2006

I have used the docmd.restore when closing a maximized report to keep the form from maximizing... but when I view a data sheet from my form then close the data sheet my form is maximized! Any help out there??:(

View 3 Replies View Related

Modules & VBA :: Save As Dialog Box - Allow User To Save Copy Of Current Database At Desired Location

Feb 12, 2014

So I have this relatively simple problem: I need to create a button that once clicked will open the Save As dialog box and allow the user to save a copy of the current database where he wishes. The filename should contain todays date in DDMM format along with some pre-set text e.g. DDMM PresetText.

I am using Access 2010.

View 2 Replies View Related

Modules & VBA :: Save Current Record In Form2 Before Enter And Send The Data To Form1

Dec 4, 2013

I have 2 form, form1 and form 2 (picture attached)

In Form 1
(main form) there are "reference" field with key pressed event
then call form 2 (list of reference that user can choose)

In form 2
the problem is, when "enter" key pressed (keypress event), selection will move to next record
so the data that transferred to form 1 is wrong (next record)

The question is : how to save current record in form 2 before enter and send the data to form 1

View 3 Replies View Related

Forms :: Create Data Entry Form To Input Data For Field

Mar 5, 2015

I an trying to create a data entry form (IndividualsEntryFm) to input data for fields such as (First Name),(Birthdate) etc., these to be saved to the (IndividualsTbl)

I also have another table (NamesTbl) which has family names etc. The two tables are linked by a (MainID) field. I want a combo box on the individualsEntryFm so that I can select the family name. Then I wish the empty fields for the IndividualsTbl to be available to enter data.When I press the save button I then want this data saved, together with the MainID from the combo box to the IndividualsTbl.

I have set the IndividualsTbl with a (PersonID) field as an auto number each individual therefore has a unique PersonID but may well share the MainID. I'm trying to link many people to the same address.

View 1 Replies View Related

Queries :: Filter Data From A Table Using Query (from Data Input Form)

Dec 30, 2014

I would like to filter data from a table using a query (from an data input form). The objective is to output all results if input form field is empty and to output results higher or equal to the type in the field if field is not Null. The query code is as follows:

IIf(IsNull([Forms]![Form2]![MaxDiffInput]);[Maximum operational pressure (bar)];[Maximum operational pressure (bar)]>=[Forms]![Form2]![MaxDiffInput])

However, is not providing any result when the input field (MaxDiffInput) as a value.

View 5 Replies View Related

Forms :: How To Save Two Input Into One Field

Feb 20, 2014

How i can save two textbox into one field

I am totally green and using unbound form

E.g.
Input
Year - Period - Month - # of working days
2014 - 01 - January - 22
2014 - 02 - February - 20

would like to save the record as follows
2014-01; January; 22
2014-02; February; 20

means input "2014 & 01", become one "2014-01"

View 1 Replies View Related

Modules & VBA :: Save Access Report As PDF And Save To Folder

Jan 10, 2014

I have a few selected reports on an Access 2007 database that users can run. Is there a way for users to view the report, save as a PDF and automatically save a copy to a shared drive by modules/vba coding as an On Click event procedure?

View 4 Replies View Related

Form Will Not Save Data

Apr 12, 2006

I have a form that no longer saves data in some fields, but does save data in others. Nothing has changed, except that it no longer saves the new data which it did save at one time. I looked at the code behind the form, and the requery statement is still there.

Any suggestions?

View 7 Replies View Related

Modules & VBA :: Use Different Column Based On User Input To Update Data

Jun 29, 2015

I'm attempting to build an import module so that my users can take data from different walks of life and import it into my tables. I'm doing this by setting up a module and allowing the user to specify which column data will come from when importing data. So lets say I have a field that is CustomerID in my table and user one pulls data from 1 place and in his excel or csv file, customerid is in field 1. Another user does the same thing and its in field 2.

How can i make some form of a loop that when I'm attempting to update data, i pull the correct column?

strSQL = "SELECT * FROM tblImportTable"
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
With rst
Do While .EOF = False
If IsNull(DLookup("DefaultValue", "dbo_tblImportTemplateDetails", "Template_ID=" & Forms!frmImport!TemplateName & " AND FieldName='CustomerID'")) Then

[code]....

View 6 Replies View Related

Forms :: Save User Input Value Into A Table

Mar 2, 2014

I need saving 2 input fields into a table. Here is the situation

tableA
studentID
Name

tableB
studentID
Name
Course
Fee

I have a form with a drop down list, to select studentID from tableA. I selected a dropdown from studentID to display Name, and that I tied to txtName

I then type in txtCourse and txtFee whatever value I want, example:

txtCourse = English
txtFee = 50.00

Now, I'm able to transfer studentID and Name from tableA and save to tableB, and delete the record I just selected in tableA.

The issue is, I can't save the txtCourse, txtFee as I don't know how.

Here is what I have

Private Sub Insert_Click()
Dim strSQL As String
strSQL = "INSERT INTO tableB SELECT studentID, Name FROM tableA WHERE studentID = '" & txtstudentID & "'"
CurrentDb.Execute strSQL

strSQL = "DELETE FROM tableA WHERE studentID = '" & txtstudentID & "'"
CurrentDb.Execute strSQL
End Sub

I'm stuck on how to save txtCourse and txtFee into tableB where I have Course and Fee fields.

View 4 Replies View Related

Using A Form To Save Data From One Table To Another

Jun 14, 2012

There is a public master database with a bunch of tables and data in it being maintained by another group. My boss wants to skim some information from this, add some of his own information to it, and save it in a completely separate .mdb file on our server.

I've used Access to link to the public database, built a custom table just for us, and built a form. The form uses bound controls on the left side to pull in data from the public database, and unbound controls on the right side for user entry of data. I coded a VBA save button that should save all controls (bound/imported as well as unbound/data entry) to our local table.

The unbound controls save just fine, but the bound controls are missing from the table. A new row is created with no problems, I get no error messages, but half the fields in the table are just blank.

Code:
DoCmd.GoToRecord , , acNewRec
Dim Rs As Recordset
'Dim SDB As Recordset
'Dim strSQL As String
Set Rs = CurrentDb.OpenRecordset("Supervisor Table", dbOpenDynaset)

[Code] .....

View 5 Replies View Related

Forms :: Two Text Boxes / Save The First Two Letters Of Each Input?

Jan 10, 2014

I want to be able to have two text boxes on my form that firstly concatenate the values inputted and then saves this string to a field.

It's a "new record" form that generates a new record in table "tblUsers".

txtB1 & txtB2 and the text boxes would represent First Name and Last Name.

But it can't be allowed to be saved as the acctual names. - Insead I'm looking for a way to take the first two or three letters of the name and concatenate these into one string of text and save that string to the field tblUsers.ConcatenatedName.

I.E.txtB1:"Carl"
txtB2:"Chapelle"

would generate "CarCha" and save that from the form to the field ConcatenatedName in tblUsers.

Btw, the values form txtB1 and txtB2 (Carl & Chapelle) cant be saved anywhere either!

Found the answer myself;

create a txtB3

And set that source to Left([txtB1];3) & " " & Left([txtB2];3)

View 1 Replies View Related

Modules & VBA :: Save Current Form Record Only As PDF

Jan 17, 2014

I'm using: DoCmd.OutputTo acOutputForm, "Frm_EL_PL_Bulk_Send", acFormatPDF, outputFileName1...To save a form as a PDF. The issue is, it saves all the records in that set in continuous form, and I'm trying to get it to only save the record its on.

View 3 Replies View Related

Modules & VBA :: Save Button For Both Form And Its Subform

Apr 22, 2014

i have a form with subform in it, and when i press the save button in the main form it saves only the records in it but it wont save the records in the subform

i found on microsoft this code
DoCmd.Save acForm, "New Employees Form"

how can i use it to save both the main form and subform together

View 3 Replies View Related

Modules & VBA :: How To Save A Formula In A Access Form

Jan 21, 2015

I put the formula in the Text box field in the control source in the property's tool box and i don't know if it will save that calculation to the table. I was wondering if i can do VBA code to save the the calculation in the table.I have a field called CA Weigt and i put the formula in there as =[Weight] * 0.4536 and it works. How would i put it in a vba code.

View 7 Replies View Related

Modules & VBA :: Save Value Of Field And Use It Once Form Closed

Apr 22, 2015

I have a MainForm. Using a button on the MainForm i open an PopUp form which I enter values.

I want to save the value of a field (text), close the PopUp form. Then use the Saved value in the MainForm to find a record.

So far I have this but not working:

Code:
TempVars.Add "company", Me.CompanyName.Value
If Me.Dirty = True Then
Me.Undo
End If
DoCmd.Close
DoCmd.OpenForm "MainForm"
DoCmd.Requery
DoCmd.FindRecord Forms![MainForm]![CompanyName] = TempVars("company")
DoCmd.GoToControl "Combo48"

View 5 Replies View Related







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