Stuck On Accessing Subform Control After 2 Days... Help?
Sep 23, 2005
Hi:
Have a employee timesheet application.
I have a form based on tblEmployees table, key Employeeid
Subform1 on that form based on tblWeekStartDate table, key weekstartdate and employeeid. I created 100 entries in this table for each employee so they can pick a week from combo box to enter their hours.
Subform2 within above subform1 based on tblTimeCard with key autonumber field.
When I click a button on main form I want to print preview a report of the form using EmployeeID from main form for critieria for main report and startweekdate field as critieria for subreport.
I'm unable to access the field weekstartdate from subform1 for the criteriea of the subreport query. Weekstardate is in the header of subform1.
In subreport query I'm using for weekstartdate criteria:
Forms!mainform!subform1.form!weekstartdate and query ignores it.
I also created an unbound textbox on mainform with:
=Forms!mainform!subform1.form!weekstartdate
thinking if I could get the subform1 value onto main form then the criteria in subreport query would access it but get #Name.
I did create a dialog box form where when clicking the print button on main form they can pick weekstartdate from dialog form and works fine. It does not make sense for the manager to pick a weekstartdate on the main form and then have to pick it again on dialog box.
I've attached the database. When the main form opens click on the report button.
Thanks!
Steve
View Replies
ADVERTISEMENT
Mar 28, 2005
I have an access db and I want to access the subform on
one of my forms. Can someone help me with the syntax
to access these forms.
I tried this but it did not work.
Code:formname.variablename
View 1 Replies
View Related
Jun 29, 2006
Hi!
I want to access individual rows in a subform (frmOrderdetails (datasheet view)).
The reason for this is that I have a checkbox at the end of each orderline, and user will be able to check individual lines and do a return of these lines.
For now, I have a query to return lines, but the problem is that when there are two lines checked, it'll only return the first one.
Anybody that knows how to obtain this?
:-)
Thank you!
View 6 Replies
View Related
Feb 8, 2006
Hi,
I had a text box on a main form linked to a text box on a sub form using the following control source =Forms!Form![frm_Doctors_details subform].[Form].[Title]. This was working, however I had to play around with the subform alot and now the link isn't working. All i get in the field is #name?. Nothing has changed on the subform textboxs, just that I added a primary key to assist in the linking action bewteen forms. I can't for the life of me get it back to what it was . any ideas??
Thanks in advance
View 4 Replies
View Related
Feb 19, 2006
Glad I found this forum.
First question as user :)
I have a database I am creating with a number of subforms. A few of the subforms I want to be able to quere data from a ODBC connection. When I use the combobox to select a system, the subforms with ODBC connections are not updated. I will not be updating any of the data on the ODBC.
Should I just create a macro that does a delete quere and then make-table quere, or is there a better way?
thanks
brandon
View 1 Replies
View Related
Jun 13, 2005
I have a form containing a subform.
Inside the form, i set up a button. Inside the OnClick code of this button, i need to access the information inside the subform.
To access the info inside the form, i know:
Me.Fieldname
But inside the subform, i have tried:
Me.SubformName.FieldName
or
SubformName.FieldName
And both did not work.
How can i?
View 2 Replies
View Related
Aug 3, 2006
OK. I have searched and searched and every thread dances around similar situations but none seem to address this particular one. I am trying to make a control on a sub form visible/not visible depending on the condition of a control on a main form. The catch is that the control I'm trying to change the state of is on a subform located in a tab control. I've tried a thousand combinations and none seem to work. How do I reference the control on the subform in a tab control?
Main Form: frmMemberMain
Tab Control: TabCtl12
Tab Control Page: 2
Subform: frmChildren
Control on subform: txtRelationship
Can someone please help before my brain explodes!! Thanks! :eek:
View 5 Replies
View Related
May 27, 2014
On a main form i have a continuous subform listing Jobs.
On the Click Event i want to display the personnel and equipment separately in two additional subforms linked to the Job i have clicked on by JobID.
I have tried all sorts of references and currently have this:-
Forms!PersonnelAndEquipmentMovementFrm.PerEquipMov Jobs.JobID = Form!EmployeeSubform.JobID.Text
Which does not work?
View 4 Replies
View Related
Sep 11, 2014
I have a form called subfrm_vactions
rowsource is a query called qryVacations
the query should calculated two things
1 - the difference between start_vac and End_vac in days to calculate the vacation period and put the value in field called Period (working well)
2-the work days which the period between the last day in Previous record (End_Vac) and the (Start_Vac) in the next record (didn't work)
the result is the difference between (End_Vac) and (Start_Vac) in the same record which i don't want
simply i want to calculate the work days.
View 5 Replies
View Related
Jan 24, 2014
I have to count the number of days each week (7 days) that a person has worked - simple enough.
But - what if they come off the job within the week?
I have been using the DateDiff function which is fine.
In the database they have a Mobdate and a DeMobDate but if the DeMobDate falls within the week the whole thing falls apart?
View 2 Replies
View Related
Dec 14, 2004
Hello everyone,
I have problem with my code here. I am using this code to determine if the LogDate with a weekday of Sunday can be declare as Sunday Work or Regular Work. The 1st week of my entry can determine if the LogDate is Sunday then compute if it reaches a 7 days working, if he is absent even 1 (one) day in his previous working days within the week. His Sunday LogDate is considered as Regular Days instead of Sunday Work. Can anyone tell me what is wrong in this code?
The problem here is the computation of 7 days after 1 week. There should be a 7 days computation every week per month in able to declare Sunday Work or Regular Work. I tried this code but it did not work on 2nd week, 3rd week and 4th week of the month.
How come on 2nd week, Sunday (LogDate) is not considered as Sunday Work even he completed the 7 days (working days) per week? I need help on this ASAP Thanks
Tim
Below is the code i'm using for defining Regular days and Sunday Working Days:
Private Sub LogDate_AfterUpdate()
Dim rst As DAO.Recordset, rs As DAO.Recordset
Dim db As DAO.Database
Dim dteToday As Date, dtePrior As Date
Dim i As Integer
dteToday = LogDate
dtePrior = DateAdd("d", -6, dteToday)
Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT [HolidayDate] FROM tblHolidays", dbOpenSnapshot)
rst.FindFirst "[HolidayDate] = #" & dteToday & "#"
'See if the date entered is a holiday
If rst.NoMatch Then
Holiday.Value = 0
Else
Holiday.Value = 1
End If
If Weekday(dteToday) = vbSunday Then 'If dated entered is a Sunday determine if
Dim strSQL As String 'it will be a regular day or a Sunday
strSQL = "SELECT [LogDate] "
strSQL = strSQL & "FROM tblLog "
strSQL = strSQL & "WHERE [LogDate] >= #" & dtePrior & "#"
strSQL = strSQL & " AND [LogDate] <= #" & dteToday & "#"
'Create a recordset of records from date entered and 7 days prior
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
rs.MoveLast
i = rs.RecordCount 'Count the number of days between the two dates
If i = 7 Then 'If there are seven days then it is a Sunday
Sunday.Value = 1
Else
Sunday.Value = 0 'If less than 7 days then it is a regular day
End If
Else
Sunday.Value = 0
End If
DayofWeek.Value = Format(dteToday, "dddd")
End Sub
View 1 Replies
View Related
Jun 14, 2013
Is there a way i can convert the weekend days into working days for example.
5/4/13 1:30 PM is on saturday what function can I use to make this day read 5/6/13 8:00 Am which is monday. Same thing for holidays.
View 1 Replies
View Related
Apr 14, 2014
I have a form where a start date is inputted (Inputfrm , StartDate) and a form where the end date of the process is recorded (Inspectionfrm , EndDate) and these both record in the table InputTbl as StartDate and EndDate respectively.
I have created a union query which shows a list of all the dates where there is work recorded (WorkingDatesQry and the column of list of unique dates is "WorkingDate"), and as we run a highly varied schedule depending on time of the year and order numbers I cannot just use a query which says Monday-Friday or Tuesday - Saturday.What I am trying to do is to find the number of days between StartDate and EndDate where there is a date recorded in the WorkingDates query.
View 1 Replies
View Related
Apr 3, 2013
Client has asked me to create a report showing summary of monthly sales by day. That was easy. I created a query for the month the user selected and then summarized and group the data by day. Client like the result but would like to see zeros on the report for non sales days. Non sales days are days like holidays and there are no sales.
I am thinking of creating an table with 31 days of zero values and then join the two tables in a query? Or, should I create a temporary table with code and then merge the two tables which the existing query which I can then use for the report?
View 4 Replies
View Related
Dec 4, 2006
I have a query and I need the records to display 3 working days before the 15 working day deadline.
I used the following in the criteria box below the received date field and it doesn't pull the correct number of workdays, it's pulling calendar days instead.
<=DateAdd("w",-12,Date())
Can anyone help, thanks for your time!!!
View 8 Replies
View Related
Dec 4, 2006
I have a query and I need the records to display 3 working days before the 15 working day deadline.
I used the following in the criteria box below the received date field and it doesn't pull the correct number of workdays, it's pulling calendar days instead.
<=DateAdd("w",-12,Date())
Can anyone help, thanks for your time!!!
View 6 Replies
View Related
Dec 26, 2006
I rent out a property , on the rental statement I have a field [Datepaid], [RentpaidFrom] and [rentpaidTo]. I would to have a field that can calculate the rent that is paid to show if the rent is in arrears or in Advance. I guess the code would be something like (datediff ???? etc) but i have no idea what it should be. the calculation should appear on the query as i.e.2 days in arrears or 12 days in advance etc
your help would be much appreciated
merry christmas to you all
Jabez
View 4 Replies
View Related
Mar 14, 2006
Dear All,
I'm new to VBA coding. A code below is copied from a friend of mine and I can't make it work. How to call up this function in my form. In my form I have 3 text boxes (StartDate, EndDate and NumOfWorkDays). My form is based on a table.
Please anyone who would help me on this, kindly give me the step by step procedure as I am really novice. Thanks in advance.
'*********** Code Start **************
Public Function WorkingDays(StartDate As Date, EndDate As Date) As Integer
On Error GoTo Err_WorkingDays
Dim intCount As Integer
StartDate = StartDate + 1
'If you want to count the day of StartDate as the 1st day
'Comment out the line above
intCount = 0
Do While StartDate <= EndDate
'Make the above < and not <= to not count the EndDate
Select Case WeekDay(StartDate)
Case Is = 1, 7
intCount = intCount
Case Is = 2, 3, 4, 5, 6
intCount = intCount + 1
End Select
StartDate = StartDate + 1
Loop
WorkingDays = intCount
Exit_WorkingDays:
Exit Function
Err_WorkingDays:
Select Case Err
Case Else
MsgBox Err.Description
Resume Exit_WorkingDays
End Select
End Function
'xxxxxxxxxxxxxxxxxxxxxxxx
Can someone please direct me to the right path.
Your help is highly appreciated.
qwerty70
View 1 Replies
View Related
Apr 26, 2005
I had a form with two tabs and then added a subform into a third tab. Until I added the subform I could see the tabs at the top in both the design view and the form view. However, since adding the subform, althougth the form looks OK in the design view, when I switch to the form view the tabs are missing. The only way that I am able to get to them is to tab through all my fields until it eventually seems to shift the page up and I can see them. If I switch to another tab and this stage I then have to go throught the same proccess of going through each of the fields until I can see the tabs again.
Hope this makes sense and someone can help!
Sam
View 2 Replies
View Related
Aug 22, 2006
How do you tab out of one subform and into another from the main form. I have 3 subforms and after a user is finished entering data into the main form the first subform sets focus. After data is entered into the subform it’s impossible to hit the “enter” or “tab” key to move onto the next subform.
View 3 Replies
View Related
Feb 25, 2006
I have two forms, ctrlpanel and users. ctrlpanel is acting as the main form and users as the subform. In a module, I have the following code inside a function that is called on in the users subform:
Code: With Forms![ctrlpanel]![users].Form!cmbSection .RowSource = strList .RowSourceType = "Value List" End With
Can't seem to figure out why I get this error. Have tried a couple different ways of doing this with the same result. here is the error:
"Microsoft Access cannot find the field 'users' referred to in your expression."
users isn't a field, it's the subform and the syntax above is how many sites show how to refer to the subform.
JMH
View 1 Replies
View Related
Nov 16, 2007
I have a subform on my main order form. I would like to click a button on my main order form and have it change a control on the subform. For instance, I have 2 controls on my subform, control 1 is a text field, and control 2 is a yes/no box.
When i click the button on my main for order form, I would like it to evaluate control 1 on my subform so that it can adjust control 2.
I would like to see if control 1 is null then set control 2 to yes or true. Thank you in advance for all your help.
View 4 Replies
View Related
Jan 18, 2008
Hi,
how can i focus on a subform control? my main form called form A has a subform called form B. Form B has a button that, when is clicked, starts a new record for Form B source. all works ok while editing form B but when i open Form A and run the same macro, i get an erro saying Form B is not open.
my macro reads-
GoToRecord
object Type Form
Object Name Form B
Record New
the button is placed on form B which is sub form to Form A.
any help really appreciated.
Nigel
View 4 Replies
View Related
Mar 1, 2005
This is probably simple, but I can't figure it out.
I have a table called Household that has a one-to-many relationship with a table called Individuals. The Individuals table has fields called FirstName and LastName. I have a main form based on Household. I want to have subforms in a Tab control based on the Individuals table. So when you click Page 1, it shows the data for the first person in the household, and when you click Page 2, it shows the data for the second person in the household. This would work by basing the subform on Page 1 on a query that finds the Min of FirstName, and basing the subform on Page 2 on a query that finds that Max of FirstName. However, the data in the subforms would not be updateable, because queries based on aggregate functions are not updateable.
Does anyone have any ideas as to how I can accomplish what I'd like to do?
View 5 Replies
View Related
Aug 9, 2005
I've use a set up that works fine on a form but doesn't when used in a subform. Basically, i have a check box and txt box that won't allow anything to be written in it unless the check box is checked. If it is checked and nothing is inputted in the text box, the lostfocus event for the txt box flags the user. It works fine in a normal form and when it's a subform, the lostfocus event does fire when going to another control in the subform. The problem is that it doesn't fire when going to another control not in the subform. Is there anyway I can get the lost focus event to fire under these circumstances?
Thanks,
scratch
View 1 Replies
View Related
Nov 10, 2005
Ok, I'm new here and I've searched through the forums and found similar questions asked but no one ever seems to have an answer. I've also looked on other forums and still no solution. So here goes...
I have a tab control with several tabs. On half of these tabs are subforms and the other tabs just have text boxes. When you click the any of the tabs, the entire tab control shifts to the bottom of the screen. The user would have to manually scroll up to continue inputting data.
I added a .gotopage method to the tab control and that fixed the problem in that when you click on a tabbed page, the page is positioned correctly on the screen. However, if I click on a tabbed page which contains a subform, I now get a VB error which says invalid page number argument.
If anyone has experienced this or knows a fix, I'd really appreciate it. Thanks! :confused:
View 6 Replies
View Related