Way To Hold Value From Field For Another Form
Sep 20, 2006
OK,
I have a form, that allows the users to enter time off for staff. It has a start date and end date fields. When they hit submit, it will enter records for all the days within this timespan into the table.
Here is the code I have on my button onclick
StartD = txtbegdate.Value
EndD = txtenddate.Value
FN = cboEmployeeName.Value
RC = cboReasonCode.Value
TM = txtteam.Value
TC = cboComments.Value
For Counter = StartD To EndD Step 1
txtbegdate.Value = Counter
Datefound = Nz(DLookup("[ExcludedDates]", "qryDateExcluded"), 0)
If Datefound = 0 Then
'Found no excluded date
txtDateOff.Value = Counter
cboEmployeeName.Value = FN
cboReasonCode.Value = RC
txtteam.Value = TM
cboComments.Value = TC
DoCmd.GoToRecord , , acNewRec
End If
Next Counter
txtbegdate.Value = ""
txtenddate.Value = ""
MsgBox "Dates added, click OK to continue!", vbOKOnly
End Sub
What I want to do next is, after it enters the data. It popups another form, that is based on a query that checks for duplicate entries for that person.
I thought using something like this right after the msg box alert, would do the trick.
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "f_findduplicates"
stLinkCriteria = "[Employee_Name]=" & "'" & Me![Text0] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
but, what happens is after the data is entered. The main form clears so the user can make the next entry. So when the popup form is generated, there is no 'employee_name' data to base the query on. so the form opens blank.
Is there a way to keep the 'employee_name' field data in a temp memory or something so the form has something to run with?
Or does anyone have a better solution? I would prefer that the data never gets entered in the first place, but I can't get anything like that to work with my current form.
thanks in advance.
Chris
View Replies
ADVERTISEMENT
Jul 30, 2014
I'm trying to make it so I could filter a subform from the main form and it will hold those results and allow them to be edited in the subform without it refiltering it. I want it to still be able to update the table by whats edited in the subform, but I don't want it to "disappear" from the subform when the filtered "matching" criteria is changed on a record.
How could I go about accomplishing this?
Here is my code for the filter of my subform:
Private Sub Form_Load()
strFilter = "[Rep Number] = " & "RepNumberField" & _
" AND " & "[UserName] = " & "UserNameField" & ""
RepReassignmentSubform.Form.Filter = strFilter
RepReassignmentSubform.Form.FilterOn = True
End Sub
View 14 Replies
View Related
Aug 17, 2014
In my DB there is a set of company-running rules that are addressed to different groups within the company, like drivers, bookkeeping, warehouse, electricians etc. Both groups and workers scope and number might change from time to time. I need to make a table that holds which worker belongs to which of these groups (one worker to one or more groups). The easiest way of setting this for the user would be kind of a matrix-look form where lines would hold the name of workers, columns would hold the groups and at the cross points there would be check boxes to set or unset membership. However I can't find the way in what table sturcture this could be utilized.
View 4 Replies
View Related
Apr 18, 2015
I am preparing a database to track the daily activities of my team. This is a real time database wherein the users will add their daily ongoing task and submit.
The action for me is, I need to capture the time required for each task.
Also, there is a possibility that the user will have to hold a task for a while/days due to some issue and will start another task. Once they have a feedback on the issue they will resume the pending/holded task.
Here, I need to capture only the time they have invested in performing the task and ignore the time spent to receive feedback on the issue. Hence the time should start when they start the activity and pause when they hold the activity. Again, the time should continue where they had paused, when they re-start the holded activvity and finally ends when the submit.
View 4 Replies
View Related
Jul 10, 2012
I manage a fleet of vehicles at work with drivers assigned to these vehicles. Each driver may opt to pay a contribution for private use of these vehicles.
This can normally be done on an excel database, however, the drivers sometimes go on leave, so I need to put their payments on hold. At this time, other drivers may take over for that period or the vehicle is left at the office. Also, the drivers change their level of contribution from time to time, so I need to adjust that accordingly too.
When the driver takes over a vehicle they complete a form that has the contribution level (there are 4 to chose from) and the dates they will have it from. They always provide a start date, however, sometimes the end date is left open.
Sometimes, driver A will say something like 'From 1 Jan 2012 To Open' then driver B may take it for a week and say 'From 1 July 2012 To 1 August 2012'.
I want to know if Access is the right tool to produce the report with the current driver, and that it will revert back to the Driver A after 1 August?
View 1 Replies
View Related
Aug 17, 2006
Group,
I thank you in advance for considering this inquiry.
From within a Form.field (based on a master table query), I desire to trigger two events; one before update and one after update.
This function will serve to document specific form.field value changes to a "log" table for review prior to being committed back to the master table.
What I'm looking for are functions, which I can use in a Macro or VBA code to facilitate a field read and copy before change and a read and copy after change triggering.
I'm sure this is absurdly simple.
View 2 Replies
View Related
Jun 12, 2013
I made a form for use in touch screen app. I would like to make a form button that will act as TAB- move from field to field in the form.
View 4 Replies
View Related
May 31, 2006
I have a problem. I have a form, being used as a subform. I have an "Original Date" field and a "Revised Date" field. I want the value the user types in the "Original Date" field to be the default value in the "Revised Date" field.
I used default value "=[OrigDate]" but that doesn't work, it just shows a blank. Both "Original Date" and "Revised Date" are in the subform.
Is there any way I can default "Revised Date" to the "Original Date" entry (and let the users change the "Revised Date" later on)
Thanks
EEK
View 6 Replies
View Related
Jul 18, 2013
How can I get the value from a field in one table (in the sub form) to copy/insert into a field in another table (in the main form) when adding a new record?The main form and sub form are linked using parent/child linking, and the sub form is in a tab.I have table A (Visit Dates) in the main form which is used to record the date of a visit to a church. Table B (Quarters and Peals) is used to record an event that took place at that church during that visit. Note that not all visits in table A require a record to be created in table B - but half or more do.
In tables A and B I have a field called "QuarterOrPealID" and these are both primary keys, though the field in table B is set to 'no duplicates' and in table A it's set to 'duplicates allowed', as table A has its own auto number/pk. They are both linked in the relationships.
So, when I add a new record to table A using the main form, I might then need to click on the tab in the sub form to create a new record in table B, which has to be linked to the same record in table A. When the "QuarterOrPealID" auto number/pk is generated in the sub form (table B), I need that value to update to the "QuarterOrPealID" field of the main form (table A), so that when I'm viewing these records the form pulls all the information nicely together.
View 10 Replies
View Related
Aug 19, 2015
I am currently stuck on set focus property. I have a main from with nested subform. I am trying to move the focus from last field of the subform to another field on the main form.
Customers(mfrm)....>Addresses(sfrm)...>Orders(sfrm Add)......>OrdDetails(sfrmOrders)
Now I have a field name [Securedesign] in frmOrderdetails and I want the tab order to navigate to field [CustomerID] in frmAddresses which is a subform to frmCustomers.
View 2 Replies
View Related
Jun 30, 2015
I have my Assets form and the primary key is the ChargerID, in this form I have an "Add New Job For This Asset" button, which opens up the Jobs form at a new record.
How do I make it so that the ChargerID field is automatically filled with whatever the previous record was instead of being blank.
For example if I have Charger12345 open in the Asset form, I'd like to click the Add New Job button and it automatically have Charger12345 in the ChargerID field of the Jobs form.
View 5 Replies
View Related
Feb 12, 2015
I have a main form and a subform.
Both forms have the field called JobID in common.
Both forms have a field called JobStatus.
Any easiest solution so that After I Update the field called JobStatus in the subform, it changes the field called JobStatus in the main form to the value which was selected from the subform?.
View 3 Replies
View Related
Oct 24, 2005
hi, i would like to be able to prevent a user from being able to change a field (lock a field) in a main form if a field in a subform is complete. (the field in the subform is named: "new_weekly_base" if this is complete then i would like the field: "weekly base" to be locked on the main form. is this possible?, please help.
the main form is named: "SCREEN-MAIN"
the subform is named: "SCREEN-SUBFORM"
(the main form has a button on it which loads the subform.)
ive tried the below code but it doesnt work, any help would be excellent.
-------------------------------------------------------
Private Sub Form_BeforeUpdate(Cancel As Integer)
If [NEW_WEEKLY_BASE] >= 0 Then
With Me.WEEKLY_BASE
.Visible = True
.Enabled = False
End With
End If
End Sub
------------------------------------------------
View 4 Replies
View Related
Feb 26, 2006
in my form I created an unbound field with a requested combination, now how can I put those in a table field.
in other words, how can I send the content of a form's unbound field to a field in the table?
your help is very appreciated.
Regards,
CS.
View 3 Replies
View Related
Jun 10, 2013
Trying to run a query using criteria to populate the query by looking at information from a field on a form, if from is closed I need that criteria to look at the table and return all date in table.
View 14 Replies
View Related
Apr 17, 2014
I have a form where I would like to validate (restrict) choices in subsequent fields.
Example
Combobox choices are Air, Fire, Water, Earth, Space
In the form I have 4 fields = Material1, Material2, Material3, Material4. (all in same record on my table)
Basically I need the validation to not allow duplicates across the 4 fields.
something like....
[Material1] <> [Material2] or [Material3]or [Material4]
I am not sure of the proper syntax for the validation field in the Form Properties. Or if I am even putting it in the right place.
View 3 Replies
View Related
Sep 13, 2013
Using Access 2010. Fairly new to automation and macros.I have two tables (tblProductReceived and tblBins) and a form (frmProductReceived).A field in tblBins corresponds to a location the bin is at (named BinLocationID) and the tblProductReceived table tracks product that a specific bin has received.
What I need is for the tblProductReceived field PRLocationID ([tblProductReceived].[PRLocationID]) to be automatically populated with where the bin is at ([tblBins].[BinLocationID]) when selecting a specific bin in the form (frmProductReceived).
View 1 Replies
View Related
Feb 5, 2014
I am creating a training database and first I have tables in relationship to the courses:
tbl_Courses
Course ID (Primary Key)
Course Title
Objectives
Instructors (lookup field allowing multiple instructors to be selected, meaning they are skilled to teach the course)
tbl_Instructors
Instructor ID (Primary Key
Last Name
First Name
Full Name (Caluclated to put Last Name, First Name)
[code]....
What I am trying to do on a form to create a new event is once the user selects the Course from the Course ID combo box, then I need the Instructor combo box to only display the instructors who are skilled to teach the course which are selected in the tbl_Courses.
I can get all Instructor ID's, but not the names and the class that has multiple instructors show on one line.Should I have not put the Instructors field in the tbl_Courses? Do I need another table for instructor skills or something?
View 1 Replies
View Related
Aug 27, 2014
What is the best way to move from the last field on the last page of a form to a new record field on the first page?
View 5 Replies
View Related
Jun 4, 2013
I am making a very simple 'registration' database for a children's event in a couple of weeks.I the table/form there is a checkbox field called 'consent' which, if checked, indicates that a child can leave the event without parental consent.
There is a report printed on each child (a registration page which the leaders get a copy of). I would like on this report a 'red box' to appear if the child cannot leave without permission (i.e. the consent box is not checked). I would also like this 'red box' to appear on the form. I had thought of doing it this way - but I'm not sure if it's the best, or if it's possible:
Have a field in my table called 'consentindicator'. When the 'consent' box is checked, there is a period ('.') placed into the 'consentindicator' field. It is set to turn red when a period is present. That way, when the consent box is checked, a get a red 'box'.
View 12 Replies
View Related
Feb 20, 2012
I am new to Access 2007 and I am having trouble in creating a form. It is simply a data storage table which would be fed in by users. That it.
I need to create a user friendly form so that :
When the user selects : Career_Goal field as "None", the next field called: Years, should be automatically be populated as 0.
In any other case, they should be able to select the years from the dropdown list.
How do I create this if else conditions? Do I use expression builder, if yes then how?
View 1 Replies
View Related
Nov 5, 2012
I've created a data entry form w/ 7 fields.... [f1], [f2], [f3], [f4], [f5], [f6] are bound to a table. While [f7] is unbound and has Nz function.
Now, the value of [f7] is the summation of [f1] to [f5], i want that what ever value is generated by [f7] will be stored on [f6] in both forms and table...
View 1 Replies
View Related
Apr 25, 2013
I have 3 peices of data that I am working with: Group number, plans and benefit elections. On my form I have fields for the group number and plan and 2 queries. When I enter a group number the first query displays a list of plan descriptions for that group. From there I can enter the plan description into the form's plan field and that runs the second query to give me a list of valid elections for that plan. This all works fine but I want to make the plan selection a little less tedious. What I would like is to be able to double click the query field housing the plan description and have it copied to the form's plan field. I could use the ID instead of the plan description but I work in a production environment and very key stroke counts so I would really like to have a simple double click process.
Is this even possible? If so how would I set that up? I tried using the double click on event macro builder but it does not seem to have this kind of option.
My form contains fields for group number and Plan. The same form houses 2 querys, one that pulls plans based on the group number and the other to pull elections based on the plan field (not the plan query). Would like to double click a plan within the plan query and have that description populated into the form's plan field.
View 6 Replies
View Related
Jul 22, 2013
I am creating a table which is called a New Connection Analysis from there I have created a form that is linked to the table. I the form I have created a combo box to show the different division e.g. Central, Western, Northern. Now the combo box is created but when I enter the data in the form once I select the division e.g. Central when I save it the data doesn't go to the Division list on the table.....How can that be fixed????
View 4 Replies
View Related
Jan 2, 2013
Is it possible to look up 2 field to auto fill another field on my form?
Field 1 is "RiskLetter" this is autofill with "Risk" is user input.
I need to lookup RiskLetter and Risk and autofill from "Number" field. This to stop incorrect data being inputted.
So I need to look at the "Risk" & "RiskLetter" to come up with a "Number"
Would it be possible to use a Dlookup to look at RiskLetter and Risk to give me the score.
View 14 Replies
View Related
Oct 24, 2012
I have a table called welding, I want to create a user friendly form for input. The database ultimately wants to go on share point so I am building it in the web database option.
One of the fields is called location, if the location is 'Field' I want 10 more fields to appear for data entry such as weld reason, rail temperature etc . If the location is 'Depot' I want these fields to be hidden as they aren't relevant.how would I do this?
View 14 Replies
View Related