silentwolf
Active member
- Local time
- Today, 00:39
- Joined
- Jun 12, 2009
- Messages
- 591
Hi guys,
I am starting a new threat but it does relate to my previous question on following threat
Not sure if that is how I suppose to refer to the other threat hope I did that right?
However I got tblAppartment, tblAppRoom and tblRoom
Shown in the below pic.
I like to create a Query that allows me get totalLivingSpace of that Appartment and the TotalSize of the Appartment like Shown in the picture I got from the Form.
The reason is to use those sqm in a Word Document as bookmarks.
For example in the Word Document.
Appartment XYZ has LivingRoom, Bedroom, Kitchen, Toilet, Bath, Balkony, ParkingArea, of total Living Space of 70 sqm and a Total Area of 75 sqm as an Balkony is not part of LivingSpace.
TheDBGuy has providet a SimpleCSV Function where I can get the Rooms of the appartment in one Field. Great function by the way
so how can I ajust it so I can get the total Sizes also into the query.
So I can have one Query providing me with AppartmentName or Address, all the rooms for that appartment, and livingRoomSizeTotal and TotalAppartmentSize which I can then use to fill bookmarks to my document,
Many thanks for your help.
oh here is the Code from TheDBGuy
Many thanks for your help
Albert
I am starting a new threat but it does relate to my previous question on following threat
Query combining records
Hi all, I have a table where comments related to a specific test are divided in several lines. For practical reasons, I want to have a table where these comments are combined. So some thing like table 2. Table 1 (original) ID | Test-ID | Comment-ID | Comment...
www.access-programmers.co.uk
Not sure if that is how I suppose to refer to the other threat hope I did that right?
However I got tblAppartment, tblAppRoom and tblRoom
Shown in the below pic.
I like to create a Query that allows me get totalLivingSpace of that Appartment and the TotalSize of the Appartment like Shown in the picture I got from the Form.
The reason is to use those sqm in a Word Document as bookmarks.
For example in the Word Document.
Appartment XYZ has LivingRoom, Bedroom, Kitchen, Toilet, Bath, Balkony, ParkingArea, of total Living Space of 70 sqm and a Total Area of 75 sqm as an Balkony is not part of LivingSpace.
TheDBGuy has providet a SimpleCSV Function where I can get the Rooms of the appartment in one Field. Great function by the way
so how can I ajust it so I can get the total Sizes also into the query.
So I can have one Query providing me with AppartmentName or Address, all the rooms for that appartment, and livingRoomSizeTotal and TotalAppartmentSize which I can then use to fill bookmarks to my document,
Many thanks for your help.
oh here is the Code from TheDBGuy
Code:
Public Function SimpleCSV(strSQL As String, _
Optional strDelim As String = ",") As String
'Returns a comma delimited string of all the records in the SELECT SQL statement
'Source: http://www.accessmvp.com/thedbguy
'v1.0 - 8/20/2013
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strCSV As String
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
'Concatenate the first (and should be the only one) field from the SQL statement
With rs
Do While Not .EOF
strCSV = strCSV & strDelim & .Fields(0)
.MoveNext
Loop
.Close
End With
'Remove the leading delimiter and return the result
SimpleCSV = Mid$(strCSV, Len(strDelim) + 1)
Set rs = Nothing
Set db = Nothing
End Function
Many thanks for your help
Albert