oxicottin
Learning by pecking away....
- Local time
- Today, 07:58
- Joined
- Jun 26, 2007
- Messages
- 870
Is it possible to limit the number of rows in a message box? I have a loop that displays data in a message box and the max rows it can accumulate from data is 74 rows which is way to long, the Yes/No button is off the screen it's so long... Is there a way to limit the number of rows of data so my message box fits on the screen? Can I have some and at the end maybe something like "............"?
Here is the loop that collects the data from a query:
Here is the full code im using:
Here is the loop that collects the data from a query:
Code:
Else
With rs
.MoveLast: .MoveFirst: intX = .RecordCount
'strMissnData = .Fields("Product") & " " & .Fields("strProductLength") & vbNewLine
Do Until .EOF
strMissnData = strMissnData & .Fields("Product") & " " & .Fields("strProductLength") & vbNewLine
.MoveNext
Loop
End With
If vbYes = MsgBox("There are " & intX & " records that are missing information for the following Products/Lengths." & vbCrLf & vbCrLf _
& " " & strMissnData & vbCrLf _
& "* You have to follow up on the missing data before:" & vbCrLf & vbCrLf _
& " 1) Emailing a Label Count" & vbCrLf _
& " 2) Saving Label Count as a .pdf", vbYesNo + vbInformation, "Missing Information") Then
Here is the full code im using:
Code:
Function FindNullRecordsOnUnload(frm As Form) As Boolean
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim intX As Integer
Dim strMissnData As String
Dim strMissnProd As String
Set db = CurrentDb()
Set rs = fDAOGenericRst("qry_FindNullRecordsOnUnload", dbOpenSnapshot)
'Set rs = db.OpenRecordset("qry_FindNullRecordsOnUnload", dbOpenSnapshot)
'--------------------------------------------------------------------------------------------------
'Open the switchboard its a new record and there isnt data missing
If frm.NewRecord Then
If CurrentProject.AllForms("frm_Switchboard").IsLoaded Then
Forms![frm_Switchboard].Visible = True
Forms!frm_Switchboard!sfrm_Switchboard.Form.Requery 'Requerys switchboard subform
End If
'--------------------------------------------------------------------------------------------------
'If you entered data in main form (frm_InventoryOverview) but didnt create records in subform then cancel and go back to form.
Dim MissinProd As DAO.Recordset
Set MissinProd = frm.Form.sfrm_InventoryDetails.Form.RecordsetClone()
ElseIf frm.Form.sfrm_InventoryDetails.Form.Recordset.RecordCount = 0 Then
MsgBox "You havent created records in your subform click the -Create Records- button!", vbInformation + vbOKOnly, "Required Data!"
FindNullRecordsOnUnload = True
'--------------------------------------------------------------------------------------------------
'If there isnt any fields left blank then close the form and open switchboard
ElseIf rs.RecordCount < 1 Then
If CurrentProject.AllForms("frm_Switchboard").IsLoaded Then
Forms![frm_Switchboard].Visible = True
Forms!frm_Switchboard!sfrm_Switchboard.Form.Requery 'Requerys switchboard subform
End If
'--------------------------------------------------------------------------------------------------
'Some data is missing, stop and display whats missing so it can be filled out, _
Run through the query (qry_FindNullRecords) and find products/lengths/quanity that data wasnt entered
Else
With rs
.MoveLast: .MoveFirst: intX = .RecordCount
'strMissnData = .Fields("Product") & " " & .Fields("strProductLength") & vbNewLine
Do Until .EOF
strMissnData = strMissnData & .Fields("Product") & " " & .Fields("strProductLength") & vbNewLine
.MoveNext
Loop
End With
If vbYes = MsgBox("There are " & intX & " records that are missing information for the following Products/Lengths." & vbCrLf & vbCrLf _
& " " & strMissnData & vbCrLf _
& "* You have to follow up on the missing data before:" & vbCrLf & vbCrLf _
& " 1) Emailing a Label Count" & vbCrLf _
& " 2) Saving Label Count as a .pdf", vbYesNo + vbInformation, "Missing Information") Then
'--------------------------------------------------------------------------------------------------
'Stop closing of form you selected YES, so finish filling out blank fields you missed
FindNullRecordsOnUnload = True 'End Function
'--------------------------------------------------------------------------------------------------
Else
'--------------------------------------------------------------------------------------------------
'You selected NO so close the form and open the switchboard
If CurrentProject.AllForms("frm_Switchboard").IsLoaded Then
Forms![frm_Switchboard].Visible = True
Forms!frm_Switchboard!sfrm_Switchboard.Form.Requery 'Requerys switchboard subform
End If
'--------------------------------------------------------------------------------------------------
End If
End If
rs.Close
Set rs = Nothing
Set db = Nothing
End Function