Recent content by T.Smith

  1. T

    After delete any record, autonumber start with next number

    It's the name of the control on your form. The control can be hidden or locked and should be reference your number field in a table. Hope this helps. Toby
  2. T

    After delete any record, autonumber start with next number

    [CODE] Dim varID As Variant If IsNothing(YourFormID) Then ' Get the previous high number and add 1 VarID = DMax("YourFieldnameInTable", "YourTableName") + 1 ' If this is first one, then value will be null If IsNull(YourFormID) Then YourFormID = 1...
  3. T

    View table size

    There's really no way to view the file size for an individual object. Access was not built with that feature. What you can do is create a new database and import the table to get the approximate table size. Toby
  4. T

    After delete any record, autonumber start with next number

    The code above looks at a table and gets the next number for a record instead of using autonumber. It will not do anything with other than that.
  5. T

    Return a read-only form to edit

    My mistake. You can do it by using the form property and not having to reopen the form. You will have to do it for each subform. Subform.Form.AllowAdditions = True Thanks for correcting me Bob. :)
  6. T

    Return a read-only form to edit

    What you can do is set the subform to a locked state on the Form's OnOpen Event. Subform1.Locked = True or... Subform1.Enabled = False After the verify password event you can unlock the subform by changing the status. (True/False). Otherwise you will have to reopen the form to allow...
  7. T

    Copying data from main form to subform

    Robert, Have a look at: http://www.mvps.org/access/forms/frm0031.htm Hope this helps. Toby
  8. T

    Simple I think

    First thing fenhow should do is remove the "Dim stDocName As String" as its no longer needed. :)
  9. T

    Simple I think

    I see that it closes the Sub but that wouldn't close the database as fenhow stated above.
  10. T

    Linking textbox to a option group

    I have used it before and for me, its easy to remember :) Toby
  11. T

    Linking textbox to a option group

    Karinos, See if this is will work. For your OnClick event: Private Sub Run_Click() Select Case Frame34.Value Case 1 DoCmd.OpenQuery "add_to_existing_contract", acViewNormal, acEdit End Select End Sub If the add_to_existing_contract query is only for that form then you can change the...
  12. T

    Simple I think

    It would be easier to read if you had tabs in the statements. Do you have any errors on compile? Toby
  13. T

    Updating a form with fields required

    This is probably what you were meaning to write. :- If Me.Status.Value = "Closed" Then If Me.P_Ref.Value & "" = "" Then MsgBox "Please ensure the P Ref field is complete", vbInformation Exit Sub End If If Me.No_Users_Reported_Affected.Value & "" = "" Then...
  14. T

    After delete any record, autonumber start with next number

    D, Your fine with that. Just create a new module and add this and you should be good. Public Function IsNothing(ByVal varValueToTest) As Integer '----------------------------------------------------------- ' Does a "nothing" test based on data type. ' Null = nothing ' Empty = nothing '...
  15. T

    After delete any record, autonumber start with next number

    Hi D, This might be what your looking for. :) Change your field from an autonumber to long integer and use the following code on your add record forms. Dim varID As Variant If IsNothing(YourID) Then ' Get the previous high number and add 1 VarID = DMax("YourFieldname"...
Back
Top Bottom