This is the code I've developed so far and also a list of about the first 20 records in the table.
Sub CombineRegHours()
Dim db As DAO.Database
Dim rec As DAO.Recordset
Dim strSQL As String
Dim sun, mon, tue, wed, thu, fri, sat As String
strSQL = "SELECT reg_Sun, reg_Mon, reg_Tue, reg_Wed, " _
& "reg_Thu, reg_Fri, reg_Sat FROM [LIB2003-Main]"
Debug.Print strSQL
Set db = CurrentDb()
Set rec = db.OpenRecordset(strSQL)
Do Until rec.EOF
sun = rec("reg_Sun"

mon = rec("reg_Mon"

tue = rec("reg_Tue"

wed = rec("reg_Wed"

thu = rec("reg_Thu"

fri = rec("reg_Fri"

sat = rec("reg_Sat"
Debug.Print sun & " " & mon & " " & tue & " " & wed & " " _
& thu & " " & fri & " " & sat
rec.MoveNext
Loop
rec.Close
End Sub
N/A|N/A|N/A|N/A|N/A|N/A|N/A
N/A|9-Sep|9-Sep|9-Sep|9-Sep|5-Sep|5-Sep
N/A|NA|NA|NA|NA|NA|N/A
N/A|N/A|N/A|N/A|N/A|N/A|N/A
NA|NA|NA|NA|NA|NA|NA
N/A|N/A|N/A|N/A|N/A|N/A|N/A
N/A|9|9|9|9|9|4
N/A|N/A|10-6:30|2:30-5:30|10-6:30|N/A|N/A
N/A |N/A |N/A |N/A |N/A |N/A |N/A
n/a|1-Sep|5-Jan|1-Sep|5-Jan|1-Sep|n/a
Closed|9-Oct|6-Oct|6-Oct|6-Oct|6-Oct|Closed
n/a|9:30-8|9:30-5:30|9:30-5:30|9:30-8|9:30-5:30|2-Oct
N/A|7-Sep|7-Sep|7-Sep|7-Sep|9-5:30|4-Sep
N/A|3:30 p.m.- 7:30 p.m.|9:00-6:00|9:00-6:00|9:00-6:00|9:00-6:00|9:00-12:00 Noon
N/A|1:00-5:00|1:00-7:00|1:00-5:00|1:00-7:00|1:00-5:00|10:00-2:00
closed|7-Sep|7-Sep|7-Sep|6-Sep|6-Sep|4-Sep
na|na|na|na|na|na|na
NA|NA|NA|NA|NA|NA|NA
NA|NA|NA|Closed|12:30 - 5:00|NA|NA
CLOSED|6-Oct|6-Oct|CLOSED|6-Oct|6-Oct|1-Sep
N/A|N/A|N/A|N/A|N/A|N/A|10:00-2:00
NA|NA|NA|NA|NA|NA|NA
N/A|9-Oct|9-Oct|9-Oct|9-Oct|6-Oct|6-Oct
N/A|9-5:30|N/A|N/A|N/A|N/A|Closed
NA|NA|NA|NA|NA|NA|NA
N/A|N/A|N/A|N/A|N/A|N/A|N/A
CLOSED|CLOSED|8-Nov|8-Nov|6-Sep|5-Aug|1-Sep
NA|NA|NA|NA|NA|NA|NA
N/A|6-Dec|N/A|6-Dec|N/A|6-Dec|1-Sep
NA|NA|NA|NA|NA|NA|NA
N/A|N/A|N/A|N/A|N/A|N/A|N/A
N/A|7-Sep|6-Sep|6-Sep|6-Jan|6-Jan|2-Sep
n/a|8-Dec|8-Oct|6-Oct|8-Dec|6-Oct|4-Oct
NA|6-Sep|8-Oct|6-Sep|8-Oct|6-Sep|6-Sep
NA|NA|NA|NA|NA|NA|NA
N/A|7-Sep|7-Sep|7-Sep|7-Sep|7-Sep|N/A
n/a|9:30-8|9:30-5:30|9:30-5:30|9:30-8|9:30-5:30|9:30-1
How can I modify the sub procedure above to get this last record in the format below?
MTh 9:30-8; TWF 9:30-5:30; S 9:30-1
In the query design view I use the 'IIf statement below to clean up the data, but would prefer to put all code in the sub procedure or function.
rsun: IIf([reg_Sun]='N/A' Or [reg_Sun]='NA' Or [reg_Sun]='n/a' Or [reg_Sun]='na' Or [reg_Sun]='Closed' Or [reg_Sun]='Not Open' Or [reg_Sun]='not open',' ',[reg_Sun])
Thanks in advance for any assistance.