Search results

  1. T

    Cross-referencing two tables on a form

    You can use DLookup() on AfterUpdate of the aircraft reg id text box. Check the Orders form in Northwind.mdb came with Access. It does the same thing you're asking for.
  2. T

    MsysDB

    I guess the mde is corrupted. Try compact it and see if it helps.
  3. T

    TabControl event not triggering

    Is the pg_BillTo a name of the page? Is it visible when you click it. You code should be OK? I don't see anything wrong.
  4. T

    Updating Data Between Form Controls

    You can use IsLoaded(), came wth Northwind.mdb, to check if form B is loaded or not. Function IsLoaded(ByVal strFormName As String) As Boolean ' Returns True if the specified form is open in Form view or Datasheet view. Const conObjStateClosed = 0 Const conDesignView = 0...
  5. T

    Query descriptions created in code

    Try the code below. Function CreateQueryDescrpt(strQuery As String, strDescrpt As String) Dim dbs As Database Dim qdf As QueryDef Dim prop As Property On Error GoTo Err_CreateQueryDescrpt Set dbs = CurrentDb Set qdf = dbs.QueryDefs(strQuery) With qdf For Each prop In .Properties '...
  6. T

    Edit a Table by VBA

    Make sure you have set DAO 3.6 in References. In Module design view, go to Tools menu>References>look for Microsoft DAO Object Library 3.6, then click to select it. Then modify the code in this part. ... Dim dbs As DAO.Database, rst2 As DAO.Recordset ... You can put the code behide form or...
  7. T

    Need help moving text around using VBA!

    Use vbCrLf. ... Dim rs As String rs = Me.Person & Me.Date & Me.Time & Me.UpdateEntry rs ="Modified by:" & Me.Person & vbCrLf rs = rs & "At:" & Me.Date & vbCrLf rs = rs & "on:" & Me.Time & vbCrLf rs = rs & "Updates added:" & Me.UpdateEntry Me.PermanentIndex = Me.PermanentIndex & rs ...
  8. T

    Loading DAO at run time....

    They both have the same name in References, DAO. Try the code below. Sub ShowRefName() Dim Ref As Reference For Each Ref In References Debug.Print Ref.FullPath & " --> Name:= " & Ref.Name Next End Sub Or check for DAO if loaded with this. Sub CheckIfDAOLoaded() Dim Ref As Reference For...
  9. T

    Search Field for my listbox

    Change this portion below to this. ... rs.MoveFirst lstFindHere = rs(fldSelect) End If ...
  10. T

    DatePart() invalid argument???

    Try this. Dim TripID As String TripID = "West" TripID = TripID & Format(DatePart("d",#7/5/02#),"00") TripID = TripID & Format(DatePart("m",#7/5/02#),"00") TripID = TripID & Right(DatePart("yyyy",Me.BeginDate),2) I wonder what's wrong with Format with you. I tried it out and resulted like...
  11. T

    Change a field name via code

    Check this out.
  12. T

    Adding notes to a memo on a subform

    Try this. ... Me.Notes.SetFocus Me.Notes.Form.NOTEPAD.SetFocus If Not IsNull(Me.Notes.Form.NOTEPAD) Then strNotePad = Me.Notes.Form.NOTEPAD Else strNotePad = "" End If) strNotePad = Now() & "--" & " " & CurrentUser() & vbCr & vbLf & strNotePad Me.Notes.Form.NOTEPAD.SelStart =...
  13. T

    Edit a Table by VBA

    Try this code out. Make sure you have back up your table before running it. Private Sub FillBlankFields() Dim dbs As Database, rst2 As Recordset Dim intValue1 As Integer Set dbs = CurrentDb Set rst2 = dbs.OpenRecordset("YourTargetTableNameHere") rst2.MoveFirst ' I assume the Null/blank field...
  14. T

    Loading DAO at run time....

    Since my last post has suppressed the error message (If Err = 32813 Then ...), so you don't see the message. You can check if it works or not by remove the DAO from the References. Then click the button, you'll find DAO is set.
  15. T

    back with more!!

    The target field must be Integer or Long. Change it to Double or Single, depending on the maximum number you expect this field will hold.
  16. T

    Loading DAO at run time....

    Change the code in this part showed below. ... Error_ReferenceFromFile: If Err = 32813 Then ' All set Exit Function ElseIf Err = 48 Then MsgBox "DLL is not found", vbOKOnly, "Missing DAO DLL" Exit Function Else MsgBox Err & ": " &...
  17. T

    listbox search forms

    You typed the code in, right? Typo, strWhere with gstrWhere..., DoCmd. with Do.Cmd...!! Change Chr$(34) to Chr$(39) if the ProcedureID field is Text, or remove it out if number. Or is the ProcedureID field exist? If not, you will get the prompt. HTH.
  18. T

    multi-select search

    I don't think the diff-viewed form will cause the problem. What method do you use since there are 2 in the linked KB activle? Post the code on the command button for opening the new form. Do you use OpenForm with filer option or change the based query SQL of the to-be-open form?
  19. T

    Loading DAO at run time....

    Try this. Function ReferenceFromFile(strFilename As String) As Boolean Dim Ref As Reference On Error GoTo Error_ReferenceFromFile Set Ref = References.AddFromFile(strFilename) ReferenceFromFile = True Exit_ReferenceFromFile: Exit Function Error_ReferenceFromFile...
  20. T

    Problem getting descending order in select statement to work

    SELECT DISTINCTROW [Year] FROM [Year] ORDER BY [Year] DESC;
Back
Top Bottom