Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
osupratt
Posting Yak Master
238 Posts |
Posted - 2008-09-17 : 14:33:46
|
I have an Access application someone else created and now have a requirement from an end-user. I currently have a field called "dbo_Field_Ticket_Header_Field_Ticket_Number". It's datatype is integer. On the before update event there is this code: Private Sub dbo_Field_Ticket_Header_Field_Ticket_Number_BeforeUpdate(Cancel As Integer) Dim lngField_Ticket_Number As Long, strCriteria As String If IsNumeric(Me.dbo_Field_Ticket_Header_Field_Ticket_Number) Then lngField_Ticket_Number = Me.dbo_Field_Ticket_Header_Field_Ticket_Number strCriteria = "[Field_Ticket_Number] = " & lngField_Ticket_Number If SearchTableByCriteria("dbo_Field_Ticket_Header", strCriteria) Then MsgBox "That ticket number already exists in the database. Please enter another ticket number.", vbExclamation Cancel = True End If Else MsgBox "INVALID TICKET NUMBER.", vbExclamation Cancel = True End If End Sub I'm want to be able to either enter in a string "SHOP TIME" to collect our shop time or down time of production. If I can't enter in this string I would like to be able to enter in a universal Field Ticket Number such as '500' for this data collection. Currently if you try to enter in a string it comes back with error. Also, if '500' is already in the database and you try to re-enter it; it comes back with an error. Would anyone know how to revise this code to either accept a string such as Shop Time or more than one ticket of the same number? I guess one more thing I would like to happen is once this is revised and I can enter one of these two things is that once updated it would 'black out' or not allow entry into about 10 other fields. Does anyone know how to accomplish this? |
|
|
|
|