Thanks Rod,
I am running MSP 2003 SP2. As I said the code is pretty rough but it does
work for the most part (no laughing too loud, LOL). We are a building
company and the form loads the client personal data to a template, before I
manually include the file in the Master Schedule.
As for the statement causing the problem - don't know, the code appears to
finish before it shows the error (doesn't ask to go to debug mode) so I am
unable to isolate the problem. Hope this helps and thanks again.
Code is:
Private Sub UserForm_Initialize()
Application.ActiveProject.Activate
TableApply name:="New Clients"
SelectSheet
Load frmAddClient
frmAddClient.show
'Load form info
'cboRepayment.List() = Array("Private", "Public", "Titan", "Other
Developer", _
"Other")
End Sub
Private Sub cmdOK_Click()
Dim job As String
Dim plan As String
Dim clname As String
Dim contact As String
Dim build As String
Dim claddress As String
Dim mobile As String
Dim phone As String
Dim email As String
Dim oc As String
Dim com As String
Dim referred As String
Dim depd As String
Dim depa As String
Dim uncondd As String
Dim unconda As String
Dim lot As String
'Set values from Selections
job = txbJobNo.Value
plan = txbPlan.Value
clname = txbClientName.Value
contact = txbContactName.Value
build = txbBuildLoc.Value
claddress = txbClientMail.Value
mobile = txbMobile.Value
phone = txbPhone.Value
email = txbEmail.Value
oc = txbOwnersCare.Value
com = txbComments.Value
referred = txbReferred.Value
depd = txbDepositDate.Value
depa = txbDepositAmt.Value
uncondd = txbUncondDate.Value
unconda = txbUncondAmt.Value
lot = txbLot.Value
SelectTaskField Row:=1, Column:="Job No"
Application.Replace Field:="Job No", Replacement:=job, test:="contains",
Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Plan", Replacement:=plan, test:="contains",
Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Client", Replacement:=clname,
test:="contains", Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Contact", Replacement:=contact,
test:="contains", Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Site Address", Replacement:=build,
test:="contains", Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Address", Replacement:=claddress,
test:="contains", Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Mobile Phone No", Replacement:=mobile,
test:="contains", Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Hm-Wk Phone No", Replacement:=phone,
test:="contains", Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Client Email", Replacement:=email,
test:="contains", Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Notes", Replacement:=oc, test:="contains",
Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Referred By", Replacement:=referred,
test:="contains", Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Lot", Replacement:=lot, test:="contains",
Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
FilterApply name:="Notes"
Application.Replace Field:="Notes", Replacement:=com, test:="contains",
Value:="", _
ReplaceAll:=True, Next:=False, MatchCase:=False
FilterApply name:="All Tasks"
FilterApply name:="Deposits"
Application.Replace Field:="Actual Start", Replacement:=depd,
test:="equals", Value:="01/01/01", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Cost", Replacement:=depa, test:="equals",
Value:="$0.00", _
ReplaceAll:=True, Next:=False, MatchCase:=False
FilterApply name:="All Tasks"
FilterApply name:="Uncond"
Application.Replace Field:="Actual Start", Replacement:=uncondd,
test:="equals", Value:="01/01/01", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Application.Replace Field:="Cost", Replacement:=unconda, test:="equals",
Value:="$0.00", _
ReplaceAll:=True, Next:=False, MatchCase:=False
Unload frmAddClient
Application.ActiveProject.Activate
TableApply name:="Entry"
FilterApply name:="All Tasks"
End Sub