Search results

  1. A

    subform – index / primary key can’t contain null value

    The problem with the null key may be on the subform rather than the form. Check to see if the subform's key is getting properly populated for all new subform records.
  2. A

    Value in field changes in record I go to to what it is in record I am leaving

    I'd need to see the database to track this one down, but I suspect that the field in question is storing its value in a global variable, rather than a table field, and that is why it is carrying through from one record to all the others.
  3. A

    Disable shift key bypass

    Put all this code into a standard module, so its scope will be the entire application. In general, you get Access to read and execute each Sub or Function simply by referencing it in the normal way anywhere in VBA code, or in certain other contexts (such as query criteria). For this particular...
  4. A

    cmdButton to Open Form at New Record

    I'm not sure if this is what you're talking about, but here goes. You can create custom database properties which are persistent (i.e., stored in the database when it's closed) yet are not stored in any table. The following code provides routines for setting, retrieving and deleting such...
  5. A

    Make Tabs Visible

    Each tab has its own Visible property, which you can set or reset in code as needed. I have an application where the tabs to be displayed vary with the characteristics of the current record, so I simply inspect those characteristics and set or reset the tabs' Visible properties in the form's...
  6. A

    VBA Problem "record locked"

    Make a copy of the database file, then attempt to delete the original. If you can't, it may mean that the network still believes that the database is in use, even though it is not. That happens on our network from time to time, and we need to get the network admins. to zap it.
  7. A

    max function

    The Max function returns only the single greatest value from a particular group. If you want all the values before a certain date, try using a criteria in your query, e.g. <#7/1/01#. You can then switch to SQL view to see how it is expressed in SQL.
  8. A

    Disable shift key bypass

    You can do this by setting the AllowBypassKey property to false, but before doing so familiarize yourself with all the implications. I would suggest you read the help topics on AllowBypassKey and Startup Options, and browse the See Also help topics that are listed with them. The code below is...
  9. A

    Sub-Forms and Linking

    I think your second method would probably run faster, but I'm not sure. You may want to review the help screens regarding troubleshooting (and improving performance of) subforms.
  10. A

    put a value in each field in my subform when I press the button "Delete"

    In the event procedure for the subform's On Delete event, put code to make the desired changes to the desired fields, and set the Cancel argument to True (to keep the delete action from actually happening). The code to change the fields can either be simple assignment statements (e.g., Field1 =...
  11. A

    Next Record button

    You're welcome! cargobay 69 is correct about setting the AllowAdditions property to False, but that will totally prevent the addition of any new records unless and until that property is reset. If you don't ever want to add new records on this form, AllowAdditions is an easier way to go. If...
  12. A

    Hiding the Access Main window while my app runs and the user navigates thru it

    Set up your own main menu form, with command buttons that open all the other forms. Then go into Tools, Startup and select that form as the Display Form, and disable the Display Database Window option. If necessary, you will still be able to display the Database window by: 1. pressing F11...
  13. A

    Event Log field

    You may want to create the event log entry only when a user changes the memo field, rather than merely clicking in it, so that only actual modifications are recorded. In the event procedure for the appropriate event (On Update or Click) for the memo field, put the following code: If Not...
  14. A

    Last record Problem

    In your VBA code: MyTextBox.Requery 'requery text box Me.Requery 'requery current form
  15. A

    Working with Tab Pages

    1. Using VBA, set the Font Weight property to Bold for each control that you want to be bold. There is no Font Weight property for tab pages, the the Font Weight property for the entire tab control appears to affect only the tab names. 2. Change the tab control's Style property to None...
  16. A

    Next Record button

    The code below will advance to the next record; if that causes it to go the new (blank) record at the end of the table, it will then go back to the previous record, sound a beep, and display the message. "Me" is a reference to the current form object, and NewRecord is a Boolean property of the...
  17. A

    Next Record button

    [This message has been edited by AlanS (edited 08-14-2001).]
  18. A

    Next Record button

    This is probably not the slickest method, but it should work. Immediately after your existing DoCmd statement, insert the following statement: If Me.NewRecord Then DoCmd.GoToRecord , , acPrevious
  19. A

    Last record Problem

    Have you tried explicitly using the Requery method of the text box (or of the form) after the new record is saved?
  20. A

    Calculating percentages and other stats

    Here's another approach, that you can simply insert into any standard module, and call from anywhere in the database. The first argument to the DCount function identifies the field you are counting, the second identifies the table, and the third (optional) states a criteria for limiting the...
Back
Top Bottom