Search results

  1. L

    Loop through all controls in a page switches the control indexes

    I'm working with Access 2003. I'm not adding any new controls. I'm not sure what you mean with "changing the nature of the controls" but I'm not changing a TextBox to a ComboBox (If such a thing is possible in the first place) But I *am* changing the names of the controls. The "weird" part is...
  2. L

    Loop through all controls in a page switches the control indexes

    Hey all, I'm writing an application that automatically adds code, events and formats the controls on a form. Basically I'm looping through all the controls like this: For Each ctr in frm.Controls Loop I also tried: For i = 0 to frm.Controls.Count -1 Set ctr = frm.controls.item(i) Next The...
  3. L

    Auto code generation

    This sounds very promising, I will check it out right away, thanks!
  4. L

    Import.csv file

    You need a Timer in your Access db that triggers a function that loops through all files in a folder. You can loop through all files in a folder using the Dir() function. You can read about Dir here: http://www.dicks-blog.com/archives/2004/04/15/the-dir-function/ Then you can open the files...
  5. L

    Macro Help

    This might not be possible. You may need to use VBA instead. str = InputBox("Give parameter:") If Len(str) > 0 Then strSQL = "SELECT * FROM table WHERE field=" & str CurrentDb.QueryDefs("qry").SQL = strSQL DoCmd.OpenQuery("qry") End If That should work. It assumes that you have a query...
  6. L

    Attendance Form - Need to auto update names and dates

    You can set a filter on a form using Me.Filter = "[Date of Attendance]='01-01-2006'" this would limit the form to all attendance with date 01/01/2006. You can filter on multiple fields like Me.Filter = "[Date of Attendance]='01-01-2006' AND [Attendance Code]='Math Class'" You can also change...
  7. L

    List/Subform Update

    If your subform is called sfcMySubForm you can access the field with: Me!sfcMySubForm.Parent.Form.Controls("txtSearchString").Text = Me!Client_Id
  8. L

    Saving

    If you enter this code in the BeforeUpdate event you will need to do something like: If IsNull(Me!tankID) Then MsgBox("Error!") Cancel = True ' This makes sure the form is not saved. Me!tankID.SetFocus End If
  9. L

    Check the properties

    Access does some automatic checking based on the field property. It checks that you don't give a string for a numeric field and checks the value of the field to the max size of the field. For string fields it is impossible to enter a string larger then the size of the table field. All this is...
  10. L

    run a silent 'SELECT QUERY' in the background

    I'm not entirely sure what you mean... You can use the following to automatically Requery a form: ' This line can be in the Form_Load event Me.TimerInterval = 100000 ' This code in the Form_Timer event Me.RecordSource = Me.RecordSource This is assuming that you want to run a query that is...
  11. L

    field with no data insert 0's

    In your case this could be something like: IIF(NOLDBA_INT_MEMBER_DEMOGRAPHIC.IVA_MEMBER_ID IS NULL, "000000000", NOLDBA_INT_MEMBER_DEMOGRAPHIC.IVA_MEMBER_ID) Note that it is not possible to select only "00000000" when IVA_MEMBER_ID is empty and multiple fields when it does have a value but you...
  12. L

    field with no data insert 0's

    You can use the IIF clause Usage: IIF(Condition, True, False) IIF(FieldName IS NULL, "0", FieldName) Or you can use a UNION clause to select the normal fields with a WHERE clause field IS NOT NULL UNION "000000000" with a where clause field IS NULL.
  13. L

    Count Duplicate Records

    Hey there, What you need to do is remove the tblCustomer.InspectionDate from your group by and select clause and only keep it in your WHERE clause (not in the having clause) Then you just need to add a COUNT(*) to your select clause and you're set. The result should be something like: SELECT...
  14. L

    Auto code generation

    Hi everyone, I am currently making an Access VBA program to help making VBA programs. For this I want to automatically generate code within a function. It should generate error handling - so I need to figure out whether it is a Sub or Function as the error handling contains an Exit...
  15. L

    Disabling Access warning when sending email

    Hi all, When sending an email using the Outlook.Application or SendObject I first get a message if I'm sure I want to send it. I believe there is a workaround but I can't make much of the information found at the MSN site, can someone provide me with some sample code or instructions on how to...
  16. L

    Too few parameters problem

    Try this: InputBox "p", "t", strsql (or debug.print strSQL) This will allow you to see and copy the query. Once copied create a new query and paste the query for a more detailed error message. Either "Description" is not a field in Pk_Item or PartNumber is a char and not an int field.
Back
Top Bottom