Search results

  1. D

    Order by in a subform

    I'm not sure how you're setting the Order By property, but you should do it in the On Open event of the subform. Key in the following to the On Open event of the subform: me.OrderBy = "[SortField]" me.OrderByOn = True Hope that helps. Doug
  2. D

    MOVE CURSOR AFTER CLICKING BUTTON

    In the On Current event of your form, put this code.. me![FirstFieldName].SetFocus That should do it for you. Doug
  3. D

    On No Data

    What you could do is set the details visible property to false. You should have a label in your report Header, or anywhere besides the detail section, that says none and has it's visible property set to false. In the No Data event, put this code.. Me.Detail.Visible = False...
  4. D

    TRICKY math problem ... need help

    Marge, The reason that you are getting zero for seconds is because "min" and "sec" are declared as integers. So Sec = Min - int(min) returns zero, because min is already equal to int(min). Declare them as doubles and you should be fine. Hope that helps. Doug
  5. D

    Help ! Please - 'Object Required' - NEARLY THERE !!!

    alright, I think I got it now... Replace the line "If stID = "" then" with "If isnull(stID) then". A null value is different than an empty string. When you use the empty string, the program thinks there is a value, which is why you're getting your invalid use of null. Hope that helps now...
  6. D

    Help ! Please - 'Object Required' - NEARLY THERE !!!

    You didn't mention where the error was coming up but I'm assuming it's coming up on the msgbox. Why are you concatenating stID to the end of your message? If you are seeing that message, then stID must be null.. Access doesn't like outputting a null value through a messagebox. If you take...
  7. D

    Help ! Please - 'Object Required'

    okay, what you could do is run a quick SQL statement to see if there is data for that record in the underlying table of the form... dim MyDB as database dim MyRecs as recordset dim MySQL as string set MyDB = currentdb MySQL = "SELECT * FROM [Your_Table]WHERE "TreatmentID=" & Me![TreatmentID]...
  8. D

    Need to add another data type...help!

    It looks like FillAllFields should be a boolean value. Try this.. dim FillAllFields As boolean
  9. D

    Opening one form based on multiple criteria delected in another form

    Steve, the left function at the end will get rid of the final "And" in your criteria string.. The code that myself and Charity wrote will loop through each of your text boxes and check if it is null.. If it is, then it will not include the field in the criteria(It will find all values for that...
  10. D

    find record according to date

    If you want the information on a form then just set up a filter. Create a form with two textboxes(txtBeginDate and txtEndDate) and a command button. On Click of the command button, put the following code if isnull(me("txtBeginDate")) then msgbox "You must fill in a beginning Date." exit sub...
  11. D

    autopopulate (new slant on older question)

    Alright, what you should do is on the Not in List event of the combo box, put the following code... dim MyDB as database dim MySQL as string set MyDB = currentdb MySQL = "INSERT INTO [Your_Table] (MCnoField) values (" & me("Combobox") & ")" This will add the MC # to your database and then you...
  12. D

    Opening one form based on multiple criteria delected in another form

    oh yeah, forgot about that... Always the little things... hehe.. Thanks Charity
  13. D

    Opening one form based on multiple criteria delected in another form

    Just run through all of your controls and build the string... stLinkCriteria = "" if not isnull(me![Customer]) then stLinkCriteria = stLinkCriteria & " [Customer Name]=" & "'" & Me![Customer] & "'" if not isnull(me![CustomerID]) then stLinkCriteria = stLinkCriteria & " [CustomerID]=" & "'" &...
  14. D

    autopopulate (new slant on older question)

    Well, for step 1, just set the Auto Expand property to yes. For 2, Set the Limit to List Property to Yes. Then, there is an event, Not in List, where you can write your code to insert a new customer. Perhaps when a new customer is entered, add the mc# to your table, then popup another form to...
  15. D

    code for autonumber

    You won't be able to use Autonumber here, but you probably could just use a number field and search through the table for an open number... This is a dirty way to do it, but it should serve your purpose... Public Function GetOpenNumber() As Long Dim MyDB As Database Dim MyRecs As Recordset Dim...
  16. D

    Getting the error "...too few parameters expected 2"

    Are you sure you have the query name spelled right? Try putting another recordset in your code and see if that works... If it works, they it is a problem with your query. Can you open and view the query normally? Does the query have parameters?
  17. D

    Email notification of an update to a record?

    DoCmd.SendObject , , , strEmail, , , "Update", me("Record_No") & " has been updated.",True Add the true at the end, then that should do it. Doug
  18. D

    Linking 2 subforms within a main form

    Can you use unbound hidden controls for these fields on the main form then link them along with the ID to each subform? That's probably the easiest way.. Doug
  19. D

    SubForms

    Just set the Link Child Fields and Link Master Fields of the subform to the names of the fields you want to automatically populate... After you populate the main form, it will populate all the child forms(subforms). Doug
  20. D

    Text box default

    in the AfterUpdate of the time employed field, put a quick if then statement.. if (full time) then if [Time Employed] >=5 me.daysoff = 25 else me.daysoff = 20 end if end if As long as the control daysoff isn't locked, you'll be able to change it and put days off in there for part-timers...
Back
Top Bottom