Search results

  1. T

    Simple Dlookup? it appears not

    Will DateSerial() help? Dim dtMyDate As Date dtMyDate = [Forms]![Transactions]![ChargeDate] dtMyDate = DateSerial(Year(dtMyDate),month(dtMyDate),Day(dtMyDate)) Then use the date variable in the DLookup() =DLookUp"[DailyHireRate]","[Rates]","[BDate]<=#" & dtMyDate & "# AND [EDate] >#" &...
  2. T

    multi-select search

    Check if the field is the same in both forms, Text or Number? Or post the code of both.
  3. T

    Setting Security Without Using MS Workgroup Functionality

    Sorry my fault. I left one " out. Put it back and try again. ... If Not IsNull(DLookup("UserNameField", "UserNamesTable","[UserNameField]='" & Me.txtUser & "' And [PasswordFieldName]='" & Me.txtPassword & "'")) Then ...
  4. T

    Bit of Data-maintenance from Lovina-Bali

    Check this update query SQL out. UPDATE tblA INNER JOIN tblB ON tblA.ID = tblB.ID SET tblA.Cost = [tblb].[Cost] WHERE (((tblA.ID)=[tblB].[ID])); tblA and tblB have ID field as a unique id. It updates Cost field in tblA with Cost in tblB. Back up your tables before doing this.
  5. T

    Strange IIF statement

    You need () for the fields. IIf(((IsNull([Approval Date])) And (Not IsNull([Operation Date]))), [Operation Date], "") You can use DCount() Dim I as Integer I = DCount("YourFieldName","YourTableName","Not IsNull([YourFieldName]) And [Your2ndFieldName] = ...")
  6. T

    Bit of Data-maintenance from Lovina-Bali

    Yes. But you must have a unique field in both tables so you can compare what to update with what. How are both tables related? What field(s) do you want to update and taking from what field(s)?
  7. T

    Adding notes to a memo on a subform

    That's strange! Try again with this line. ... Me.Notes.SetFocus DoCmd.GoToControl "NOTEPAD" ...
  8. T

    Adding notes to a memo on a subform

    Try this. Dim intstart As Integer Dim strNotePad As String Me.Notes.SetFocus Me.Notes.Form.NOTEPAD.SetFocus strNotePad = Me.Notes.Form.NOTEPAD strNotePad = Now() & "--" & " " & CurrentUser() & vbCr & vbLf & strNotePad intstart = Len(strNotePad) Me.Notes.Form.NOTEPAD = strNotePad
  9. T

    "Object Required" error

    I guess it has to do with SetFocus somewhere in your code. Why don't you rem the lines and see if it helps. Or rem the On Error GoTo Err_cmdNewRecord_Click line, and try to click the button. When you are prompted for the error message, just click debug button. There you will see what line causes...
  10. T

    Form with changing SubForm

    You mean you use only one subform, but want to show diff record groups depending on the criteria in the combo? Both categories are kept in one table? If so, you'll need only one subform, but change the subform record source based on the category combo box. Post the SQL of the subform query...
  11. T

    Adding notes to a memo on a subform

    Chage to the blue line. ... Me.Notes.SetFocus Me.Notes.Form.NOTEPAD.SetFocus NOTEPAD = Now() & "--" & " " & ...
  12. T

    Update queries

    Criteria - - Not Like "*" & "regular" & " *"
  13. T

    exporting crosstab queries

    Why don't you create a new table based on the crosstabl query by using Make Table query, then export the newly created table to Excel. See if it helps!
  14. T

    Setting Security Without Using MS Workgroup Functionality

    You suppose to have 2 text controls on the sign-up form. The first one for user name and the other for password. I assume their names are txtUser and txtPassword. Then create a command button and put the code below to it on On_Click event. Private Sub Command1_Click() If Not...
  15. T

    Selecting Form record from SubForm

    Just create the combo box containing the values (must be unique values) of the field in subform1-based table. Then on On_Update of the combo, use the code below to do the task. Private Sub Combo0_AfterUpdate() Dim I as Long ' (or Integer) I =NZ(DFirst("ID","subform1-based...
  16. T

    odd & even Numbers

    The SQL below sorts even numbers first, then sorts the odd numbers. I assume the table names tblOddEvenNos with the Number field. SELECT tblOddEvenNos.Number FROM tblOddEvenNos WHERE ((([number] Mod 2)<>0 Or ([number] Mod 2)=0)) ORDER BY [number] Mod 2, tblOddEvenNos.Number; and the SQL sorts...
  17. T

    Button to delete a record

    You must have a unique field in each table linked all the tables together. If they are One-To-Many links, you have to delete the Many side table first, then delete the One side table. Private Sub Command0_Click() Dim dbs As Database If MsgBox("Wanna delete '" & Me.ID & "'?", vbYesNo, "Sure?") =...
  18. T

    Bit of Data-maintenance from Lovina-Bali

    Do you want to change the stored records to uppercase? You may use a update query with the StrConv() or use code to loop thru all the record and converse all to uppercase. Or just put > (greated sign) in the Format property of the fields you want to make them look uppercase. Or if you want the...
  19. T

    Adding notes to a memo on a subform

    Set the focus to the subform first, the move the cursor to the control. Private Sub Command0_Click() Me.Notes.SetFocus Notepad.SetFocus End Sub
  20. T

    Open form and add record

    On On_Click of the 2 buttons, use this line to open the form in AddMode (go to the Add New Record) DoCmd.OpenForm "YouFormName Here", , , , acFormAdd and use this line for the other. DoCmd.OpenForm "YouFormName Here", , , , acFormReadOnly If you also want to edit the data, just replace...
Back
Top Bottom