Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[blue]Public Function ClearTables()
Dim db As DAO.Database, tbl As TableDef
Set db = CurrentDb()
For Each tbl In db.TableDefs
If tbl.Attributes = 0 Then
DoCmd.RunSQL "DELETE * FROM " & tbl.Name & ";"
End If
Next
Set db = Nothing
End Function[/blue]
[purple]HotKeys[/purple] are a means of running macros or VBA from the key board. The [purple]HotKeys[/purple] are run from the specific macro object [purple]AutoKeys[/purple]. An example will serve best ([blue]you might as well set this up in preparation for the [purple]ClearTables[/purple] function[/blue]):[blue]What you mean by setting up a hotkey combination with an [purple]Autokeys Macro !!![/purple][/blue]
[blue]Public Function TestHotKey()
MsgBox "HotKey is Working!"
End Function[/blue]
[blue]Macro Name Action Function Name
---------- ---------- -------------
^+{F9} Run Code TestHotKey()
Stop Macro[/blue]
When your satisfied with the hotkeys, replace the [blue]function name[/blue] in the macro with [purple]ClearTables()[/purple] and your set.TheAceMan said:[blue][purple]click-itis:[/purple]
That condition which occurs when the finger keeps going, although brain to hand is disconnected ;-)[/blue]
Besides the tables you design, there are [purple]hidden system tables[/purple] used to track objects throughout the entire database. To see them, in the database window click [blue]Tools[/blue] - [blue]Options...[/blue] - [blue]View Tab[/blue]. Check [purple]System objects[/purple] & click ok. Now goto your tables window and you'll see the additions.[blue] Why in the loop you have [purple]only tbl.Attributes = 0 ![/purple][/blue]
Well . . . you dont really. What compacting does as far as autonumber is concerned, is set the next autonumber to the highest used +1, per table. So if a tables has no records, autonumberis reset back to zero.[blue]Why do I need to reset the autonumbers. Is it because otherwise they couldn't be allocated again !?[/blue]