Ok, here's the code for adding a new entry.
Function AddNewPost()
Dim MyWorkspace As Workspace, MyDatabase As Database
Dim MyTable As Recordset
Dim MyFile As String
Dim ErrorCondition As Integer
Dim NewRecord As String
UpdateDb = True
'Check for "" - zero blocks
'and replace them with a " " (space)
'since it doesen't like updating the database
'with a empty string.
If company_name.Text = "" Then company_name.Text = " "
If company_phone.Text = "" Then company_phone.Text = " "
If company_fax.Text = "" Then company_fax.Text = " "
If company_email.Text = "" Then company_email.Text = " "
If company_custnr.Text = "" Then company_custnr.Text = " "
If contact_name.Text = "" Then contact_name.Text = " "
If contact_phone.Text = "" Then contact_phone.Text = " "
If contact_cellu.Text = "" Then contact_cellu.Text = " "
If contact_fax.Text = "" Then contact_fax.Text = " "
If contact_email.Text = "" Then contact_email.Text = " "
If IT_name.Text = "" Then IT_name.Text = " "
If IT_phone.Text = "" Then IT_phone.Text = " "
If IT_cellu.Text = "" Then IT_cellu.Text = " "
If IT_fax.Text = "" Then IT_fax.Text = " "
If IT_email.Text = "" Then IT_email.Text = " "
If system_os.Text = "" Then system_os.Text = " "
If system_sp.Text = "" Then system_sp.Text = " "
If network_type.Text = "" Then network_type.Text = " "
If problem_desc.Text = "" Then problem_desc.Text = " "
If problem_solution.Text = "" Then problem_solution.Text = " "
If date_start.Text = "" Then date_start.Text = " "
If date_stop.Text = "" Then date_stop.Text = " "
If uc_first.Text = "" Then uc_first.Text = " "
If uc_last.Text = "" Then uc_last.Text = " "
MydbString = initdb.Combo1.Text
MyFile = MydbString ' Define name of database.
On Error GoTo DBErrorHandler ' Enable error trapping.
Set MyWorkspace = Workspaces(0)
' Open database.
Set MyDatabase = MyWorkspace.OpenDatabase(MyFile)
If Not ErrorCondition Then
On Error GoTo TableErrorHandler ' Enable error trapping.
' Open table.
Set MyTable = MyDatabase.OpenRecordset("bugreport"

If Not ErrorCondition Then
On Error GoTo EditErrorHandler ' Enable error trapping.
MyTable.AddNew ' Enables adding new records.
MyTable![company_name] = company_name.Text ' Add the new record.
MyTable![company_phone] = company_phone.Text ' Add the new record.
MyTable![company_fax] = company_fax.Text ' Add the new record.
MyTable![company_email] = company_email.Text ' Add the new record.
MyTable![company_custnr] = company_custnr.Text ' Add the new record.
MyTable![contact_name] = contact_name.Text ' Add the new record.
MyTable![contact_phone] = contact_phone.Text ' Add the new record.
MyTable![contact_cellu] = contact_cellu.Text ' Add the new record.
MyTable![contact_fax] = contact_fax.Text ' Add the new record.
MyTable![contact_email] = contact_email.Text ' Add the new record.
MyTable![IT_name] = IT_name.Text ' Add the new record.
MyTable![IT_phone] = IT_phone.Text ' Add the new record.
MyTable![IT_cellu] = IT_cellu.Text ' Add the new record.
MyTable![IT_fax] = IT_fax.Text ' Add the new record.
MyTable![IT_email] = IT_email.Text ' Add the new record.
MyTable![system_os] = system_os.Text ' Add the new record.
MyTable![system_sp] = system_sp.Text ' Add the new record.
MyTable![network_type] = network_type.Text ' Add the new record.
MyTable![network_dom] = network_dom.Value ' Add the new record.
MyTable![network_workg] = network_workg.Value ' Add the new record.
MyTable![problem_desc] = problem_desc.Text ' Add the new record.
MyTable![problem_solution] = problem_solution.Text ' Add the new record.
MyTable![date_start] = date_start.Text ' Add the new record.
MyTable![date_stop] = date_stop.Text ' Add the new record.
MyTable![problem_solved_yes] = problem_solved_yes.Value ' Add the new record.
MyTable![problem_solved_no] = problem_solved_no.Value ' Add the new record.
MyTable![uc_first] = uc_first.Text ' Add the new record.
MyTable![uc_last] = uc_last.Text ' Add the new record.
MyTable.Update ' Save changes.
NewRecord = "true"
MyTable.Close ' Close table.
End If
MyDatabase.Close ' Close database.
End If
On Error GoTo 0 ' Disable error trapping.
If NewRecord = "true" Then
MsgBox "Databasen har uppdaterats, felrapporten inlagd.", vbExclamation
End If
Exit Function
DBErrorHandler:
ErrorCondition = True
UpdateDb = False
NewRecord = "False"
MyString = "Kan inte öppna databasen, " & MyFile & " v.g. försök igen. Vid bestående fel ring 9136."
MsgBox MyString, vbExclamation
Resume Next
TableErrorHandler:
ErrorCondition = True
UpdateDb = False
NewRecord = "False"
MsgBox "Kan inte öppna den aktuella tabellen, ring Christian på Helpdesk.", vbExclamation
Resume Next
EditErrorHandler:
ErrorCondition = True
UpdateDb = False
NewRecord = "False"
MsgBox "Kan inte uppdatera ett av fälten, v.g. kontrollera uppgifterna.", vbExclamation
Resume Next
End Function