Search results

  1. B

    setting passwords on command buttons

    I forget the exact function you need, but it is similar to the CurrentUser() function. As long as you set up a group in the security settings, and assign the correct people to the group, you can check if the current user is a member of the specific group. Duane Barker
  2. B

    Understanding Code execution in Reports

    I have created a fairly complicated report which provides Delivery Ratings for a specified period based on very specific criteria. The report doesn't give me the output that I expected. I have examined the code in great detail, and it SHOULD work properly. I have stepped through the code...
  3. B

    Variable not declared as a particular data type

    I believe the $ signifies a string variable Duane Barker
  4. B

    BeforeUpdate Validate using Form and Subform

    Your validation here can become quite complex. It is pretty simple to test for a particular value in multiple records by looping through a recordset, testing for a condition, updating a Boolean variable flag, and then moving to the next record. The second item can also be accomplished by...
  5. B

    Combo Boxes

    You can do this a couple of ways. You could use a DLookup, include the fields in a query, or use a recordset. I use the recordset. Put this code in the OnLostFocus Event of the Employee # combobox. Make sure to limit to list. 'First check for a value in combobox. If Isnull(me.cmbName) =...
  6. B

    Trying to update date to current whenever a specific condition is met...

    Try using the Lost Focus event, and add this line of code. If IsNull(Me.[Closed_Date]) = True Then 'Do your code Else 'Do not change the date if a valid one is already present. End If It may be easier to provide the user with a checkbox control and make the closed status a Boolean field in the...
  7. B

    Linking combo boxes and records

    I assume you open the second form with a command button. On the ON Click Event of the Command button, add a little bit of code. 'First, check to make sure there is a valid value in the combobox. If IsNull(me.cmbName) = True Then 'Set focus to combo box to enter valid info. msgbox$("No Value...
  8. B

    filter not allowing record add

    The best way to check if the query is updateable is to run the query and then try to add or change a record. Duane Barker
  9. B

    filter not allowing record add

    Applying or removing a filter should have no effect on adding a new record. You should check a couple of things. 1. Security Settings 2. Form properties - set to edit only 3. Recordsource of the form may not be updateable if based on multiple tables. Duane Barker
  10. B

    filtering nightmare

    Each data entry person has a specific region? This sounds like something you can do by creating a mini lookup table with user names and region codes. on the load event of the form, check the value of CurrentUser(), and use DLookUp in the table to filter based on the region code. Duane Barker
  11. B

    COMBO BOX

    If you bind the combobox to the control you need, and don't even bother setting it's Rowsource until you trigger the GotFocus Event of the Combobox, it should work fine. Here is a sample of code that I used to set the rowsource of a combobox based on a value. If IsNull(Me.TagNumber) Then...
  12. B

    COMBO BOX

    You need to set this dynamically. The source of the Combobox only gets set when you load the form. What happens if the user keeps changing the value in the selected field, and expects a different ComboBox rowsource? I would write some code for the GotFocus Event of the ComboBox control that...
  13. B

    Multiple pages with tabs

    I'm not sure if this is the right syntax, but it will give you a start. me.TabControlName.pages(0).SetFocus I think this is right. Use pages(1) etc to access subsequent pages. You need to think also about the frustration of users if they click out of the control with the movement code, and...
  14. B

    Filter help

    If you want to use a filter, type in the code: Forms![YourForm].Filter=strYourFilterString Forms![YourForm].FilterOn=True Duane Barker
  15. B

    memo field not working as one?

    I have had this exact problem in the past. It seems that Access treats a memo field as a text field in certain instances, like when formatting is applied to the memo field. Try removing all formatting from the control. Duane Barker
  16. B

    Incomplete info Message Box

    The code I wrote checks the value before you try to write the record to the database. If you want it to check before leaving the text box, you will need to use the text box On Exit event. You need to write soething to check for a valid record, since it is very annoying to have this message box...
  17. B

    EOF

    IS this a recordset object? If it is, you may not have set the source of the recordset properly. The statement will work properly if there is a valid recordst object that is at end of file. Access cannot locate the End of file property unless the recordset is opened correctly. Duane Barker
  18. B

    need to make a custom function to split a sentence into words

    An easy way to build the SQL clause would be to use the IN keyword. create a string variable and build it with delimiters and the book titles. I would use a loop to build the string. Dim inputstr As String 'Add an extra space to capture last data item inputstr = inputstr & " " Dim...
  19. B

    Incomplete info Message Box

    Put this bit of code on the form Before Update Event if isnull(me.[controlname]) then msgbox$("Your message") docmd.cancelevent me.[controlname].setfocus endif
  20. B

    Sum in form footer

    Have you added a control with Expr2 bound to it on the form? I'm not too sure, but I believe that you can only use the Sum() function on a bound control. You must use the name of the control in the Sum() function. If you don't want the control to appear on the form, you can set its' visible...
Back
Top Bottom