Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

MS ACCESS Forms & SubForms


  • Please log in to reply

#1
swicklund

swicklund

    Member

  • Member
  • PipPip
  • 25 posts
I have a Form that is a list of dates, and a subForm that is all the projects worked on for a given date, with the hours for each.

I would like to have a field on my main form that is the total hours on a given date, and I would like this field updated whenever the hours for a project on that date is updated. I have tried some VBA code in the "After Update" box on the subForm, but that does not seam to be working.

Help?? :)
  • 0

Advertisements


#2
Gumby©

Gumby©

    Member

  • Member
  • PipPip
  • 20 posts
In the footer of the subform, add a textbox. In the ControlSource for the textbox enter the following (without the quotation marks) "=Sum([name of your hours field])" (don't forget to use both the round and square brackets). Then, on the main form, add a textbox where you want the total hours shown and add the following to it's ControlSource (again, without the quotation marks) "=name of subform.Form!name of textbox on subform". For example, if the new textbox on the subform with the total is called txtTotal and the subform is called Projects, the ControlSource for the new textbox on your main form would read as follows "=Projects.form!txtTotal" If either the name of the subform or the total textbox has spaces (i.e., subform name = Project Details) then make certain that the name is enclosed in square quotes (i.e., [Project Details])

Hope that helps.

Gumby©
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP