Recent content by ntp

  1. N

    Advanced combo boxes on form please help!!

    You will need to use the AfterUpdate event of the first combo box, combo1, to set the recordsource of the second combo box, combo2. e.g. Private Sub Combo1_AfterUpdate() me.combo2.enabled = true me.Combo2.recordsource = "SELECT tableb.FieldA, TableB.FieldB FROM TableB WHERE...
  2. N

    Combo Box Restrictions

    YOu will need to use two events to handle this. There are twoi events you are trying to manipluate, the event where a new record is being added - information about parts for a supplier and the event where parts are bieng added for a supplier. The first event occurs on your main form. You have...
  3. N

    Reference a field by its ordinal number

    Try changing your code to this: Dim rstpiklst As Recordset Set dbs = CurrentDb Set rst = dbs.OpenRecordset("MyTable", dbOpenDynaset) rst.MoveFirst rst.edit With rst for i = 0 to 9 .Fields(i) = "Default" .Update next i End With You need to add rst.edit to 'open' the recordset for editing or...
  4. N

    TreeView Control

    Go to this site: http://support.microsoft.com/support/kb/articles/Q165/4/37.ASP you can download a sample database which has examples on how to use various ActiveX controls. ntp
  5. N

    HELP NEEDED NOW!!! CurrentUser Function

    Check out this site: http://www.mvps.org/access/general/gen0034.htm There's some info on how to get the currently logged on user. You would have to put code in each of the form you want to perform auditing on in the opne event procedure e.g. Private Sub Form_Open() With rstAuditFormOpen Do...
  6. N

    TimeClock

    Create a form and remove the close button, max,min buttons so the user can't close it. Set it's Timer interval to some amount of milliseconds. Write an ontimer event to open the form. As for the limit llkhoutx spoke about, I'm pretty sure that is enough time, unless you are going to have the app...
  7. N

    Week Number

    Try this function Private Function WeekOfMonth(dte as Date) as Integer WeekOfMonth = DateDiff("ww", DateSerial(Year(dte), Month(dte), "01"), dte, vbMonday, vbFirstFourDays) + 1 End Sub You'll get the week. ntp Additional Point: My solution gives you the week in the current month, Rich's...
  8. N

    #Name? error, but only sometimes

    Hello Graham, You can try wrapping the Val Funcion around you references to the textboxes. e.g. Sum(Val([Price 1]) + ... ntp
  9. N

    verify change of data

    Another option would be to simply inform the user that an item is going to be added. When an item is not found on the list you display a message and they can agrre to either an add, a filter or a cancel. ntp
  10. N

    Retrieving X number of records

    Modify your query like this: original query: SELECT field1, field2 FROM qrySample New query: SELECT TOP X field1, field2 FROM qrySample ORDER BY field1 The new query returns the first X records returned when the queryis sorted by field1. ntp
  11. N

    Heading in a Form

    actually each form has a header and footer secrtion. You can put any controls you want in this section it will always remain at the top of your form even if the user scrolls down or up. if you look at your form in design view you will see header, details and footer. the space between the header...
  12. N

    Go back to current record

    Dim varBookmark as Variant To record a bookmark varBookmark = rst.Bookmark To set the current record to the bookmark rst.bookmark = varBookmark You can decide which controls and events need to handle this sort of thing. ntp
  13. N

    Password Protect A Form

    When the user creates a project I assume you will have some table storing information about it. Particularly a uniquely identifying field. Have a table with this ID and the password the user inputs. When the user tries to open the project next time, you check this table for the password. And...
  14. N

    Code to tell if a query name exists?

    Use this function Public QueryExists(strQryName as String) as Boolean Dim qdf as QueryDef Dim boolExists as Boolean boolExists = False For each qdf In currentdb.queryDefs If qdf.Name = strQryName then QueryExists = True Exit Function End if...
  15. N

    Lookup values

    Run this query to limit your values: strSQL = "SELECT TOP 4 [ID], [cal] FROM [Client Details] WHERE [cal] <= " & varC & " ORDER BY [ID];" This SQL code will return all records whose [cal] vales are less than or equal to the varC value. The TOP 4 predicate will limit the returned records to...
Top Bottom