Thanks again.
-Scott
'Onclick event that triggers PopulateFields
Dim add As ClsInfo
Public cmdEnter_Click()
Dim foo As RegExp
Set foo = New RegExp
foo.Pattern = "^[0-9]{5}$"
If foo.Test(txtShop.Text) = False Then
MsgBox "Please re-enter the shop order number."
With txtShop
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
Set foo = Nothing
Exit Sub
End If
Set foo = Nothing
Set add = New ClsAdd
'Populate fields on frmAddShop
add.PopulateFields txtShop.Text, "Add"
Set add = Nothing
frmAddShop.Show
Unload Me
'From frmAdd
'Where the text boxes should be assigned values
Dim add As ClsInfo
Public Sub Form_Load()
On Error GoTo ErrorHandler
Set add = New ClsAdd
txtJobOrder.Text = add.IdJob
Screen.MousePointer = vbDefault
Exit Sub
ErrorHandler:
Select Case modLib.ProgError(Err, Me.Name)
Case 3 ' Abort
End
Case 4 ' Retry
Resume
Case 5 ' Ignore
Resume Next
End Select
End Sub
'Class Info
Option Explicit
Public Property Let PcMk(ByVal vData As String)
End Property
Public Property Get PcMk() As String
End Property
Public Property Let Descr(ByVal vData As String)
End Property
Public Property Get Descr() As String
End Property
Public Property Let IdItem(ByVal vData As String)
End Property
Public Property Get IdItem() As String
End Property
Public Property Let OrdLine(ByVal vData As String)
End Property
Public Property Get OrdLine() As String
End Property
Public Property Let AddTime(ByVal vData As String)
End Property
Public Property Get AddTime() As String
End Property
Public Property Let AddDate(ByVal vData As Date)
End Property
Public Property Get AddDate() As Date
End Property
Public Property Let Add4(ByVal vData As String)
End Property
Public Property Get Add4() As String
End Property
Public Property Let Add3(ByVal vData As String)
End Property
Public Property Get Add3() As String
End Property
Public Property Let Add2(ByVal vData As String)
End Property
Public Property Get Add2() As String
End Property
Public Property Let Add1(ByVal vData As String)
End Property
Public Property Get Add1() As String
End Property
Public Property Let CustName(ByVal vData As String)
End Property
Public Property Get CustName() As String
End Property
Public Property Let CustId(ByVal vData As String)
End Property
Public Property Get CustId() As String
End Property
Public Property Let CustPo(ByVal vData As String)
End Property
Public Property Get CustPo() As String
End Property
Public Property Let IdSo(ByVal vData As String)
End Property
Public Property Get IdSo() As String
End Property
Public Property Get IdJob() As String
End Property
Public Property Let IdJob(ByVal strNewValue As String)
End Property
Public Property Get IdBdl() As String
End Property
Public Property Let IdBdl(ByVal strNewValue As String)
End Property
Public Function PopulateFields(ByVal ShopOrderNumber As String, ByVal method As String)
End Function
'Class Add
Option Explicit
Implements ClsInfo
Private m_IdSo As String
Private m_IdBdl As String
Private m_IdJob As String
Private m_CustPo As String
Private m_CustId As String
Private m_CustName As String
Private m_AddTime As String
Private m_addDate As Date
Private m_Add1 As String
Private m_Add2 As String
Private m_Add3 As String
Private m_Add4 As String
Private m_OrdLine As String
Private m_IdItem As String
Private m_Desc As String
Private m_PcMk As String
Private Sub Class_Reset()
m_IdSo = ""
m_IdBdl = ""
m_IdJob = ""
m_CustPo = ""
m_CustId = ""
m_CustName = ""
m_AddTime = ""
m_addDate = ""
m_Add1 = ""
m_Add2 = ""
m_Add3 = ""
m_Add4 = ""
End Sub
Private Property Let ClsInfo_Add4(ByVal RHS As String)
m_Add4 = RHS
End Property
Private Property Get ClsInfo_Add4() As String
ClsInfo_Add4 = m_Add4
End Property
Private Property Let ClsInfo_Add3(ByVal RHS As String)
m_Add3 = RHS
End Property
Private Property Get ClsInfo_Add3() As String
ClsInfo_Add3 = m_Add3
End Property
Private Property Let ClsInfo_Add2(ByVal RHS As String)
m_Add2 = RHS
End Property
Private Property Get ClsInfo_Add2() As String
ClsInfo_Add2 = m_Add2
End Property
Private Property Let ClsInfo_Add1(ByVal RHS As String)
m_Add1 = RHS
End Property
Private Property Get ClsInfo_Add1() As String
ClsInfo_Add1 = m_Add1
End Property
Private Property Let ClsInfo_AddDate(ByVal RHS As Date)
m_addDate = RHS
End Property
Private Property Get ClsInfo_AddDate() As Date
ClsInfo_AddDate = m_addDate
End Property
Private Property Get ClsInfo_AddTime() As String
ClsInfo_AddTime = m_AddTime
End Property
Private Property Let ClsInfo_AddTime(ByVal RHS As String)
m_AddTime = RHS
End Property
Private Property Get ClsInfo_CustId() As String
ClsInfo_CustId = m_CustId
End Property
Private Property Let ClsInfo_CustId(ByVal RHS As String)
m_CustId = RHS
End Property
Private Property Get ClsInfo_CustName() As String
ClsInfo_CustName = m_CustName
End Property
Private Property Let ClsInfo_CustName(ByVal RHS As String)
m_CustName = RHS
End Property
Private Property Get ClsInfo_CustPo() As String
ClsInfo_CustPo = m_CustPo
End Property
Private Property Let ClsInfo_CustPo(ByVal RHS As String)
m_CustPo = RHS
End Property
Private Property Let ClsInfo_Descr(ByVal RHS As String)
m_Desc = RHS
End Property
Private Property Get ClsInfo_Descr() As String
ClsInfo_Descr = m_Desc
End Property
Private Property Get ClsInfo_IdBdl() As String
ClsInfo_IdBdl = m_IdBdl
End Property
Private Property Let ClsInfo_IdBdl(ByVal RHS As String)
m_IdBdl = RHS
End Property
Private Property Let ClsInfo_IdItem(ByVal RHS As String)
m_IdItem = RHS
End Property
Private Property Get ClsInfo_IdItem() As String
ClsInfo_IdItem = m_IdItem
End Property
Private Property Get ClsInfo_IdJob() As String
ClsInfo_IdJob = m_IdJob
End Property
Private Property Let ClsInfo_IdJob(ByRef RHS As String)
m_IdJob = RHS
End Property
Private Property Get ClsInfo_IdSo() As String
ClsInfo_IdSo = m_IdSo
End Property
Private Property Let ClsInfo_IdSo(ByVal RHS As String)
m_IdSo = RHS
End Property
Private Property Let ClsInf

rdLine(ByVal RHS As String)
m_OrdLine = RHS
End Property
Private Property Get ClsInf

rdLine() As String
ClsInf

rdLine = m_OrdLine
End Property
Private Property Let ClsInfo_PcMk(ByVal RHS As String)
m_PcMk = RHS
End Property
Private Property Get ClsInfo_PcMk() As String
ClsInfo_PcMk = m_PcMk
End Property
Private Function ClsInfo_PopulateFields(ByVal ShopOrderNumber As String, ByVal method As String)
'==============================================================================
'= Title: Public Function PopulateFields() =
'=----------------------------------------------------------------------------=
'= Description: Populates the field in frmAddShop =
'=----------------------------------------------------------------------------=
'= Author(s): Scott Rose =
'=----------------------------------------------------------------------------=
'= Inputs: =
'=----------------------------------------------------------------------------=
'= Creation Date: 10/10/2001 =
'= Version: 1.0 =
'= Revisions: =
'==============================================================================
Dim db As clsDBConnection
Dim strPath As String
On Error GoTo ErrorHandler
Set db = New clsDBConnection
'Change mouse pointer to hourglass
Screen.MousePointer = vbHourglass
'SQL Statement
db.Project_strSql = "Select ID_SO, ID_ORD, SEQ_LINE_ORD, ID_ITEM_PAR, ID_PO_CUST, ID_CUST_SOLDTO, ID_JOB, NAME_CUST, ADDR_1, ADDR_2, ADDR_3, ADDR_4, DATE_ADD, TIME_ADD, DESCR_ITEM_1, DESCR_ITEM_2 FROM tblTest where ID_SO like '%" & ShopOrderNumber & "'"
db.ProjectConnect
Set db.Project_rs = db.Project_My_Conn.Execute(db.Project_strSql)
'If EOF then the shop order was not found.
'Prompt, return focus on the form and set bstatus to false
If db.Project_rs.EOF Then
MsgBox ShopOrderNumber & " does not exist. Please re-enter another shop order."
bStatus = False
db.ProjectDisconnect
Set db = Nothing
Exit Function
Else
If m_IdJob <> "" And m_IdBdl <> "" Then
'Set check = New clsDBConnection
db.Project_strSql = "Select ID_SO from zebradb where ID_JOB = '" & _
m_IdJob & " ' and ID_BDL = '" & _
m_IdBdl & "' and ID_SO = " & m_IdSo
'check.ProjectConnect
Set db.Project_rs = db.Project_My_Conn.Execute(db.Project_strSql)
If Not db.Project_rs.EOF Then
MsgBox "The shoporder number " & m_IdSo & _
" has already been entered for bundle " & m_IdBdl
bStatus = False
db.ProjectDisconnect
Set db = Nothing
Exit Function
Else
If db.Project_rs("ID_JOB"

<> m_IdJob And bpass = False Then
MsgBox "The job number does not match the previous job number."
bStatus = False
db.ProjectDisconnect
Set db = Nothing
Exit Function
Screen.MousePointer = vbDefault
End If
End If
End If
If (bStatus = False And m_IdJob = ""

Or (bStatus = True) Or (bStatus = False And m_IdJob <> ""

Then
'Set text box values
m_IdSo = LTrim(db.Project_rs("ID_SO"

)
m_OrdLine = db.Project_rs("ID_ORD"

& db.Project_rs("SEQ_LINE_ORD"

m_IdItem = db.Project_rs("ID_ITEM_PAR"

m_IdJob = db.Project_rs("ID_JOB"

m_Desc = Replace(db.Project_rs("DESCR_ITEM_1"

, "*", ","

m_PcMk = IIf(IsNull(db.Project_rs("DESCR_ITEM_2"

), "", db.Project_rs("DESCR_ITEM_2"

)
m_IdJob = db.Project_rs("ID_JOB"

m_CustPo = db.Project_rs("ID_PO_CUST"

m_CustId = db.Project_rs("ID_CUST_SOLDTO"

m_CustName = db.Project_rs("NAME_CUST"

m_Add1 = IIf(IsNull(db.Project_rs("ADDR_1"

), "", db.Project_rs("ADDR_1"

)
m_Add2 = IIf(IsNull(db.Project_rs("ADDR_2"

), "", db.Project_rs("ADDR_2"

)
m_Add3 = IIf(IsNull(db.Project_rs("ADDR_3"

), "", db.Project_rs("ADDR_3"

)
m_Add4 = IIf(IsNull(db.Project_rs("ADDR_4"

), "", db.Project_rs("ADDR_4"

)
m_addDate = db.Project_rs("DATE_ADD"

m_AddTime = db.Project_rs("TIME_ADD"
'show that this pass is without error
bStatus = True
bpass = False
'db.Project_rs.MoveNext
'if the job ids do not match then show there were errors
db.ProjectDisconnect
'Set add = Nothing
Set db = Nothing
End If
'End Select
End If
Screen.MousePointer = vbDefault
End Function
Scott
Programmer Analyst