473,659 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make table from code?

Hi!
A form load with the following code (3 listboxes):

With Me!lstOnr
.RowSource = ""
.ColumnCount = 6
.ColumnHeads = True
.ColumnWidths = "0cm;1,501cm;1, 752cm;0cm;0cm;1 ,501cm"
.BoundColumn = 1
.RowSource = "SELECT tblOrdrer.Ordre ID, tblOrdrer.Ordre nr,
tblOrdrer.Dato, tblOrdrer.Kunde ID, tblOrdrer.Ansat tID,
tblAnsatte. Initialer, tblOrdrer.Retur nr " _
& "FROM tblAnsatte
INNER JOIN tblOrdrer ON tblAnsatte.Ansa ttID = tblOrdrer.Ansat tID " _
& "WHERE (((tblOrdrer.Or dreNr) = Forms!frmOrdrer !OrdreNr));"
End With

With Me!lstPersOppl
.RowSource = ""
.ColumnCount = 7
.ColumnHeads = True
.ColumnWidths = "0cm;1,251cm;4c m;4cm;0cm;1,255 cm;4cm"
.BoundColumn = 1
.RowSource = "SELECT tblKunder.Kunde ID, tblKunder.Kunde nr, tblKunder.Navn,
tblKunder.Adres se, tblKunder.Postn rID, tblPostnr.Postn r, tblPostnr.Sted " _
& "FROM tblPostnr
INNER JOIN tblKunder ON tblPostnr.Postn rID = tblKunder.Postn rID " _
& "WHERE (((KundeID) = Forms!frmOrdrer !KundeID));"
End With

With Me!lstVareInfo
.RowSource = ""
.ColumnCount = 9
.ColumnHeads = True
.ColumnWidths = "0cm;2cm;0cm;4c m;4cm;1,251cm;1 ,251cm;1,251cm; 1,251cm"
.BoundColumn = 1
.RowSource = "SELECT tblDelordrer.Or dreID, tblDelordrer.De lordreID,
tblDelordrer.Va reID, tblVarer.Varena vn, tblVarer.VareDi mensjon,
tblDelordrer.Pr is, tblDelordrer.Me ngde, tblDelordrer.Ra batt,
tblDelordrer.Mi ljoavg " _
& "FROM tblVarer
INNER JOIN tblDelordrer ON tblVarer.VareID = tblDelordrer.Va reID " _
& "WHERE (((tblDelordrer .OrdreID) = Forms!frmOrdrer !OrdreID));"
End With

Now...

Can I make a table, say tblMyTemp, filled with these data in code?

The purpose is to fill a table with data that I want to send to a report.

Any suggestions?

Me.Name
Nov 13 '05 #1
2 1514

Geir Baardsen wrote:
Hi!
A form load with the following code (3 listboxes):

With Me!lstOnr
.RowSource = ""
.ColumnCount = 6
.ColumnHeads = True
.ColumnWidths = "0cm;1,501cm;1, 752cm;0cm;0cm;1 ,501cm"
.BoundColumn = 1
.RowSource = "SELECT tblOrdrer.Ordre ID, tblOrdrer.Ordre nr,
tblOrdrer.Dato, tblOrdrer.Kunde ID, tblOrdrer.Ansat tID,
tblAnsatte. Initialer, tblOrdrer.Retur nr " _
& "FROM tblAnsatte
INNER JOIN tblOrdrer ON tblAnsatte.Ansa ttID = tblOrdrer.Ansat tID " _ & "WHERE (((tblOrdrer.Or dreNr) = Forms!frmOrdrer !OrdreNr));"
End With

With Me!lstPersOppl
.RowSource = ""
.ColumnCount = 7
.ColumnHeads = True
.ColumnWidths = "0cm;1,251cm;4c m;4cm;0cm;1,255 cm;4cm"
.BoundColumn = 1
.RowSource = "SELECT tblKunder.Kunde ID, tblKunder.Kunde nr, tblKunder.Navn, tblKunder.Adres se, tblKunder.Postn rID, tblPostnr.Postn r, tblPostnr.Sted " _ & "FROM tblPostnr
INNER JOIN tblKunder ON tblPostnr.Postn rID = tblKunder.Postn rID " _ & "WHERE (((KundeID) = Forms!frmOrdrer !KundeID));"
End With

With Me!lstVareInfo
.RowSource = ""
.ColumnCount = 9
.ColumnHeads = True
.ColumnWidths = "0cm;2cm;0cm;4c m;4cm;1,251cm;1 ,251cm;1,251cm; 1,251cm" .BoundColumn = 1
.RowSource = "SELECT tblDelordrer.Or dreID, tblDelordrer.De lordreID, tblDelordrer.Va reID, tblVarer.Varena vn, tblVarer.VareDi mensjon,
tblDelordrer.Pr is, tblDelordrer.Me ngde, tblDelordrer.Ra batt,
tblDelordrer.Mi ljoavg " _
& "FROM tblVarer
INNER JOIN tblDelordrer ON tblVarer.VareID = tblDelordrer.Va reID " _ & "WHERE (((tblDelordrer .OrdreID) = Forms!frmOrdrer !OrdreID));"
End With

Now...

Can I make a table, say tblMyTemp, filled with these data in code?

The purpose is to fill a table with data that I want to send to a report.
Any suggestions?

Me.Name


Am I missing something here? Why not use a query to gather the data
required, then use the query as the Record Source of the Report?

Nov 13 '05 #2
"Geir Baardsen" <ge***********@ hotmail.com> wrote
A form load with the following code (3 listboxes):

With Me!lstOnr
.RowSource = ""
.ColumnCount = 6
.ColumnHeads = True
.ColumnWidths = "0cm;1,501cm;1, 752cm;0cm;0cm;1 ,501cm"
.BoundColumn = 1
.RowSource = "SELECT tblOrdrer.Ordre ID, tblOrdrer.Ordre nr,
tblOrdrer.Dato, tblOrdrer.Kunde ID, tblOrdrer.Ansat tID,
tblAnsatte. Initialer, tblOrdrer.Retur nr " _
& "FROM tblAnsatte
INNER JOIN tblOrdrer ON tblAnsatte.Ansa ttID = tblOrdrer.Ansat tID " _
& "WHERE (((tblOrdrer.Or dreNr) = Forms!frmOrdrer !OrdreNr));"
End With

With Me!lstPersOppl
.RowSource = ""
.ColumnCount = 7
.ColumnHeads = True
.ColumnWidths = "0cm;1,251cm;4c m;4cm;0cm;1,255 cm;4cm"
.BoundColumn = 1
.RowSource = "SELECT tblKunder.Kunde ID, tblKunder.Kunde nr, tblKunder.Navn, tblKunder.Adres se, tblKunder.Postn rID, tblPostnr.Postn r, tblPostnr.Sted " _ & "FROM tblPostnr
INNER JOIN tblKunder ON tblPostnr.Postn rID = tblKunder.Postn rID " _
& "WHERE (((KundeID) = Forms!frmOrdrer !KundeID));"
End With

With Me!lstVareInfo
.RowSource = ""
.RowSource = "SELECT tblDelordrer.Or dreID, tblDelordrer.De lordreID,
tblDelordrer.Va reID, tblVarer.Varena vn, tblVarer.VareDi mensjon,
tblDelordrer.Pr is, tblDelordrer.Me ngde, tblDelordrer.Ra batt,
tblDelordrer.Mi ljoavg " _
& "FROM tblVarer
INNER JOIN tblDelordrer ON tblVarer.VareID = tblDelordrer.Va reID " _
& "WHERE (((tblDelordrer .OrdreID) = Forms!frmOrdrer !OrdreID));"
End With
I will reply to the code-table-query issue in another email. But what
needs to be pointed out here is that you are needlessly setting all these
properties in the onOpen event. Set the properties of the listboxes at
design time, in design view.

Certainly these:
.ColumnCount = 9
.ColumnHeads = True
.ColumnWidths = "0cm;2cm;0cm;4c m;4cm;1,251cm;1 ,251cm;1,251cm; 1,251cm"
.BoundColumn = 1


Should rarely be set in code, unless you are for some reason using the same
listbox for multiple queries of very different type.

Setting the RowSource to a blank string is useless if you turn around and
set it to a SQL query just a few lines later.

Why not just have the rowsource already part of the listbox? Why do this on
open at all??
Darryl Kerkeslager
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

82
10670
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | | | | | | | | left | center | right | | | | | | | | |
1
4316
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i want to make first text as Table Heading/menu category. For examle in the given menu i want to make a heading as "Comp. Languages" which won't be a link. 2) The position of this menu is absolute to the page. I want to make it absolute to the Table...
14
4286
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to salvage the records from the many table and without going into detail, one of the reasons I can't do the opposite as there are records in the ONE table that I need to keep even if they don't have any child records in the MANY table. Below I created...
7
5084
by: rednexgfx_k | last post by:
All, Problem Summary: I've running about 30 make table queries via VBA in Access 2000, and my database goes from 14,000k to over 2,000,000k. In addition, the longer the procedure runs, the bigger the performance hit VBA takes. I'm wondering how to prevent or reduce this. Details: I have a database table of queries I want to run. This table contains the query name, the SQL text of the query, the name of the target table, and whether...
16
11546
by: Miguel Dias Moura | last post by:
Hello, i have 5 panels in an ASP.net / VB page. The panel 1 is visible the other 4 are NOT visible. I also have 5 images: image 1, image 2, ..., image5. When i click one of the images, image N, the panel N becomes visible and all the other invisible.
4
12333
by: ken | last post by:
Hi, I use this command to run a make table query without opening it... CurrentDb.Execute "make table query name" Access tells me that it can't execute a select query...? Its a make table query not a select? Or are those two the same. Bottom line is that the DoCmd.OpenQuery alowes the user to see the query and I don't want that... Anything else I could use other then Currentdb.execute?
6
4868
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
10
2171
by: Extremest | last post by:
I know there are ways to make this a lot faster. Any newsreader does this in seconds. I don't know how they do it and I am very new to c#. If anyone knows a faster way please let me know. All I am doing is quering the db for all the headers for a certain group and then going through them to find all the parts of each post. I only want ones that are complete. Meaning all segments for that one file posted are there. using System;
6
5924
by: Ian Boyd | last post by:
Every time during development we had to make table changes, we use Control Center. Most of the time, Control Center fails. If you try to "undo all", it doesn't, and you end up losing your identity seed, or your constraints, or your triggers, or your table. Talking to developers at other companies who have had the misfortune of using DB2, they are adamant that you cannot use the tools; they are buggy and you just have to resign yourself to...
6
20544
by: abctech | last post by:
Helo Friends, I am a novice Java programmer, I'm working with Jsp + Javascript to develop a web application.I only have basic Html knowledge and I mostly use "FrontPage" to develop my web pages but currently my webpage requires some dHtml and CSS fundamentals hence I'm posting a query in this forum expecting some guidance, I have a floating table in my webpage which I achieved using JS. I have written Jsp code to get database records one...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.