You may want to try the built-in Excel Data Form for managing an Excel database. On the pull-down menu it is Data-Form...
The default form will update a database, search, querry and all sorts of things automatically. To set it up label a block of columns with your field names put the cursor in the first record(row) and activate the utility.
The code below will work with a table that is on the same sheet as the navagation menu. I use buttons and Photo objects that act as buttons to activate the code below.
For your data table start in AA1 with cells labled as text and lable the fields for cells (AA1,AB1,AC1...) then load the table with at least one data element in AA2 (A dummy like: "First Record" or 1, anything will work.) this sets the table for the data-form defalts. The Data-Form will use your column lables as the forms field lables on the input screen. It all works very slick.
The code below uses the Sendkeys command to activate or use the Data-Form.
Note Data forms can display a maximum of 32 fields at one time. You can only have one Data-List per sheet, but you may have many sheets in a workbook each with it's own Data Form and Data Table. JSW
Use Form Buttons or hot-keys to run the macros below!
Sub DBForm()
'Macro made; 12/13/2001, By: Joe Was.
'Keyboard Shortcut: Ctrl+b.
'Runs (Opens) the DataBase input Form.
'Calibrate screen for scroll to DataBase-Data-Table.
Sheets("Menu").Select
Range("A1").Select
ActiveWindow.SmallScroll ToRight:=13
'Select first DataBase record.
Range("AA2").Select
'Clean Screen and show Default Data Form.
ActiveWindow.ScrollColumn = 1
SendKeys "%do"
End Sub
Sub myExit()
'Exit the database form.
SendKeys "%fx"
End Sub
Sub myClose()
'Close the datbase form.
SendKeys "%fc:"
End Sub
Sub myPrint1()
'Print the data table.
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Print Data Now?" ' Define message.
Style = vbOKCancel ' Define buttons.
Title = "Ready to Print?" ' Define title.
'Help = "DEMO.HLP" ' Define Help file.
'Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title)
If Response = vbOK Then ' User chose Yes.
Columns("AA:AI").Select
ActiveSheet.PageSetup.PrintArea = "$AA:$AI"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.ScrollColumn = 1
Else ' User chose No.
GoTo Can
End If
End
Can:
End Sub
Sub mySave()
'Save this workbook.
ActiveWorkbook.Save
End Sub
Sub VDBT()
'Move to the data table.
Range("AA2").Select
End Sub
Sub MainView()
'Return to the navagation menu.
ActiveWindow.ScrollColumn = 1
End Sub