473,511 Members | 14,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can i create a new table using login data from a form?

1 New Member
I have the following code but only i can, is to create new table by giving the name.

I want to use "Forms!Login!cboUser" as the new name.


Expand|Select|Wrap|Line Numbers
  1. Private Sub Command46_Click()
  2.     If DLookup("[AccessLevelID]", "Users", "[UserID] = " & Forms!Login!cboUser) = 1 Then
  3.  
  4.     Dim dbs As Database
  5.  
  6.     Set dbs = OpenDatabase("Z:\AA - Product Pictures\ACCESS PHOTO LIST\photo list - Test")
  7.  
  8.     dbs.Execute "CREATE TABLE NewTable" _
  9.         & "([Item No] TEXT, Quantity NUMBER);"
  10.     End If
  11. End Sub
  12.  
Thanks in advance

John
Dec 19 '15 #1
1 948
zmbd
5,501 Recognized Expert Moderator Expert
jplatrit
Yes this can be done; however, one would not normally do such a thing as it breaks the rules of normalization.

So, before any of our experts will assist you with this, we have an obligation to hopefully show you a better method of design; thus, to that end, let us start with two things:
1) The concept of - Database Normalization and Table Structures
2) Why you need to create the table?
Dec 19 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2450
by: Sandros | last post by:
Background: I'm collecting usability statistics for a group of applications. Each count has the following attributes: date, application, major heading, minor heading, count. My intent is to pull...
1
575
by: Question with BinaryReader | last post by:
Is someone can give me example? I want to create Bitmap with pixel data saved in a binary file, the data file only have red data block and green data block. I have implemented it with VC6.0, now...
1
9163
by: vector | last post by:
I want to dynamically create tables in a SQL Server 2000 database that are modelled after XML schemas. I will not know what the schemas might look like until the documents arrive. For example,...
1
6765
by: rdeanstew | last post by:
I have created a query and saved it. The Access 2003 allowed me to create a table using the query. To the life of me I can't find out where to do this in A2007. Can someone either answer this or...
10
2041
by: mina10a | last post by:
Please help me. iTs very urgent. I have three Tables 1 Student_master: stu_id(pk),name,phoneno,fathername,address,collegename,class,photo; 2 Student_detail slno(pk),stu_id(fk),...
4
1834
by: Mangala Teli | last post by:
I have table as Table1 p_cd dt qty price amt 001 12/13/2009 10 20 200 002 12/14/2009 5 10 50 001 12/15/2009 10 20 200 001 12/19/2009 8 20 160 i want result as p_cd ...
1
3727
by: db2maf | last post by:
Hi Gurus, My system: DB2 v9.5_FP0 (Windows). I have two questions that I seek help with: 1. I want to create a table using the following: - db2 create table SCHEMA.DBCFG like...
1
1376
Seth Schrock
by: Seth Schrock | last post by:
I'm creating a billing database and currently, I'm pulling records from the sales table using the current CustomerID, and two textboxes to give a date range as the criteria for the query. From here,...
0
1178
by: wild123 | last post by:
I have a VB6 project with multiple databases (ms access) and multiple forms In one existing table, I have changed an empty unused text field data type to OLE. How do I use the form in the vb...
0
7251
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,...
0
7148
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...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5072
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...
0
4743
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...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
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 ...
0
451
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...

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.