ajetrumpet
Banned
- Local time
- Today, 13:39
- Joined
- Jun 22, 2007
- Messages
- 5,628
Chill out Bro, just giving you a little ****

Chill out Bro, just giving you a little ****
Trying to figure what out? The issue of this thread?? How could it be that important? It's not like your users are going to say "Oh well, this is too complicated, I'll go find another job. They wouldn't, would they!? Gosh, I hope not!trying to figure this out. im almost at the point where i say... F-it!!![]()
Trying to figure what out? The issue of this thread?? How could it be that important? It's not like your users are going to say "Oh well, this is too complicated, I'll go find another job. They wouldn't, would they!? Gosh, I hope not!
Actually, this problem is quite interesting. Like I said, I was trying to figure out how to use two arrays for this stuff, but I didn't get to the end of it. I might try working on this a bit later. There shouldn't be a problem using arrays for this. I wonder if one of the other gurus hear has any advice about this?
For intcounter = 1 to .Recorcount
Created what the same??what if i created them all the same at first and then updated them based on the values in the combo boxes...
In that case, write this...at this point im not gonna be picky about the size of the code, just want to get somtehing working
dim rs as recordset
dim c as control
dim str as string
set rs = me.recordsetclone
for each c in me.controls
str = c.name
if typeof c is combobox then
if str Like "cbocase*" then
with rs
.addnew
!casefield = c
!expensetype = me.cboexpensetype
!expensename = me.txtexpensename
!paymentmethod = me.cbopaymentmethod
!amount = me.txtamount
!paidto = me.txtpaidto
!additionalinfo = me.txtadditionalinfo
.update
end with
end if
end if
Next
End Sub
Select Case MsgBox("Do you want to save your changes to the current record?" & vbCrLf & vbLf & " Yes: Saves Changes" & vbCrLf & " No: Does NOT Save Changes" & vbCrLf & " Cancel: Reset (Undo) Changes" & vbCrLf, vbYesNoCancel + vbQuestion, "Save Current Record?")
Case vbYes: 'Save the changes
Me.CLICKSAVE.Value = "Yes"
Dim rs As Recordset
Dim c As Control
Dim str As String
Set rs = Me.RecordsetClone
For Each c In Me.Controls
str = c.Name
If TypeOf c Is ComboBox Then
If Not IsNull(c) Then
If str Like "cbocase*" Then
With rs
.AddNew
!CaseID = c
!ExpenseTypeID = Me.cboExpenseType
!ExpenseName = Me.txtExpenseName
!PaymentMethodID = Me.cboPaymentMethod
!ExpenseAmount = Me.txtExpenseAmount
!ExpensePaidTo = Me.txtExpensePaidTo
!ExpenseAdditionalInfo = Me.txtExpenseAdditionalInfo
!TaskID = Me.TaskID
!ExpenseAddedby = Me.txtEmpInitials
!DateExpenseAdded = Me.TODAYDATE
!ExpenseReimbursement = Me.chkAssigntoAgent
!EmployeeID = Me.EmployeeID
!ExpenseDate = Me.txtExpenseDate
.Update
End With
End If
End If
End If
Next
Case vbNo: 'Do not save or undo
'Do nothing
Case vbCancel: 'Undo the changes
DoCmd.RunCommand acCmdUndo
Me.CLICKSAVE.Value = "No"
Case Else: 'Default case to trap any errors
'Do nothing
End Select
I wonder if it's because of the comma...??
At the beginning of the code, you have comments about saving. Are you saving the information in the record somewhere in there?ok ive fixed the mismatch error, but now im getting a duplicate of the first record that is saved
anyone see why?
DoCmd.GoToRecord, , , acNewRec