Search results

  1. N

    Filtering on sub form wont work...

    It seems to me that you are starting in the wrong place, then?:confused: If your main form is concerned with companies and you are searching for orders irrespective of company, then it sounds like you should be using a form based on orders which then shows the company to which the order belongs...
  2. N

    Filtering on sub form wont work...

    In your subform control, what do you have as the Link Master Fields and Link Child Fields values? From your description, I would expect these to be CompanyID for the Master and CoID for the Child. When you want to find details for order 123 for company 1, I assume you start with that company on...
  3. N

    Filtering on sub form wont work...

    How is your subform related to the parent? It sounds as if your filter is contradicting that relationship. I did wonder why you wanted to filter the subform, because the linkage forms an automatic filter in effect. Any additional filter you apply would be on the subset of records which are...
  4. N

    Filtering on sub form wont work...

    Try referring to the subform through its containing control. If your subform is in a control named sbfChild, use Me.sbfChild.Form.Filter = strfilter2 Me.sbfChild.Form.FilterOn = True This code would be in the parent wherever you need it.
  5. N

    Dlookup Defaults

    It just occurs to me that the default value you want in your drop-down boxes is always 1, so in the properties of each control for product (Prods, Prods2, Prods3), you can set the Default Value to 1. That will have the same effect as the code and will solve your problem. That's a much neater...
  6. N

    Dlookup Defaults

    No, that's not correct. if you have multiple fields, then set the focus to each one in turn, amend its value and move on to the next one. Your code would look like this:Private Sub Form_Current() If Me.NewRecord Then Rem set focus to the first product name control Me.Prods.SetFocus Rem set...
  7. N

    VBA for Payroll form

    Looking at your Payroll Entry Form, it appears that the bottom part of the form represents a subform (from MEP Number down). However, it looks as if you have entered the rows individually (judging by the alignments)? I suggest you create the subform with the variable fields contained in it...
  8. N

    Dlookup Defaults

    If I read this correctly, the two DLoopkUp statements are the row source for unbound controls? They both use a pre-defined query (qryproddetails) as their data source? This being true, then the 'Error' message comes from the value of productid not being recognised when the form loads - it is...
  9. N

    Can I Enter Sub Name In On Click Property?

    Yes, that's right. If you have a Public Sub named DoSomeThing, then simply change the word 'Sub' to 'Function'. You don't need a return value from the function (unless your logic has need of it). In the control's Click event, you would enter=DoSomeThing() If you want to generalise the code to...
  10. N

    Question How do I enter a % value in access

    Set the format of your field in its properties page to show percentage.
  11. N

    Query based on two other querys.

    You need to look at the way your two queries are joined. Have a look at INNER JOIN to determine the linkage if you are working directly in SQL. Otherwise, you can use the query wizard to construct a query which selects the relevant records from each data source.
  12. N

    VBA for Payroll form

    You can do what you want by placing the daily record entries in a subform within the main form. You don't really need VBA in this context because the mechanism is built-in to the subform to show current records. The form contained in the subform control should be in continuous view mode in order...
  13. N

    Can I Enter Sub Name In On Click Property?

    You can use a Public Function name in the button click event, but not a Sub. You must include the closing parentheses, even if there are no parameters to the function.
  14. N

    Dlookup Defaults

    Is the form frmsales open when the code runs? What is the value in its field prods and is that value compatible with prodid? Try the DLookup without the third parameter to see if the results change.
  15. N

    Macro for search button

    Have you linked the macro to the command button's Click event? With the form in design view, select the button and look at its properties. In the Events tab, the top entry is the Click event and from the drop-down box, you can select your macro name. If you have this set up already, then please...
  16. N

    Need help in a very simple calculation!! PLZZ Urgent

    Try using a single "d" in the function parameters. You also need to have a numeric value for the interval and a date value for the date (as opposed to strings), so you need to enforce the data types if the controls return text.
  17. N

    Dlookup Defaults

    What type of controls are 'Product Name' and 'Product Price'? What is their control source (i.e. are they bound to a field in a table or unbound)? If unbound, the values are presumably calculated somewhere and put into the controls? Is '0' the value you want in these controls for a new record...
  18. N

    Open new form based on this record

    If the ticket number is created in an autonumber field of a record, it implies that the form is bound to the table. Does the creation of the ticket number happen in the past (as in some time before "now")? If not, you should be able to pick the number up using the first method. As you say, the...
  19. N

    Update Query

    If you post your query it would help, with further details on the data types of the fields used.
  20. N

    Disable form button after macro is finished

    In the click event of your button, you can disable the drop-down box:Private Sub CommandButton_Click Me.ComboBox.Enabled = False End Sub You will have to re-enable the combo box at some point. The Form's Current event could be used for this:Private Sub Form_Current Me.ComboBox.Enabled = True End Sub
Back
Top Bottom