473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VB programming function

14
Hello All,

I've been doing some reading to see if I could do this function in my VB programming but it's definitely to advance for me. I have a form whose main source is a query. I am using a Docmd.RunSql INSERT INTO function to insert the record on the form to a table. The record gets inserted into the table after a selection is made from a combo box. The question I have is how do I make the account to no longer be available to the user after it is inserted into the table. It does not matter to me if it is filtered, hidden or if it append to the table.
I've tried to do the append query but it appends the whole query not the individual account. Any input or resources anyone can provide would be greatly appreciated.
Dec 11 '06 #1
9 1541
NeoPa
32,556 Expert Mod 16PB
Do you think you could explain what you're after a little more clearly Bface.
I think there may be an easier way than you're trying but I don't really understand what you're trying to do.
Dec 11 '06 #2
Bface
14
Hi NeoPa,

On my main form I have a combo box which the user has options (Completed, Reviewed, etc.) to select from. Once a selection is made from the combo box the Acct#, PT_name and the selection from Combo box is inserted into a table. In the Combo box AfterUpdate event I entered the code Docmd.RunSql INSERT INTO tblactivity….

After the user have made a selection from the combo box I would like for the account to no longer be available to the user. Is there a way to filter the account from the remaining list. I am not sure if I am using the right term. The idea is if there is a total of 100 accounts for them to go through there should be a way for them to identify which ones they have already looked at. That’s why I was thinking maybe the account can be filtered from the list. I hope this makes sense.
Dec 11 '06 #3
NeoPa
32,556 Expert Mod 16PB
BFace,

I'll try to have a look at this a little later (Work - you know :().
In the mean-time, the table MetaData would probably help here.
Post it in Code tags to keep the layout clean.
Expand|Select|Wrap|Line Numbers
  1. Table Name=
  2. ID; Autonumber; PK
  3. FieldName1; Numeric
  4. FieldName2; String
  5. etc
Dec 11 '06 #4
Bface
14
Hi NeoPa,

Thanks for taking the time to help me out. I didn't realize you were at work. Ok I have a new idea, since all the account information I need is being transferred to another table then the account can be deleted. As you can tell I am getting desperate. I posted the code below, if you could please let me know what code I can insert to delete the account after it is transferred. Thanks again for all your help.

Code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub ComboActivity_AfterUpdate()
  2.  
  3. DoCmd.SetWarnings False
  4.  
  5. mySQL = "INSERT INTO Tbl_AcctWcodes ([Acct#],PT_Name, Acct_Bal, Pt_Status, FC, SC, ComboActivity) Select [forms]![Main Acct Details]![ACCT#] as a, [forms]![Main Acct Details]![PATIENT NAME] as b, [forms]![Main Acct Details]![ACCT BAL] as c, [forms]![Main Acct Details]![S] as d, [forms]![Main Acct Details]![F_C] as e, [forms]![Main Acct Details]![S/C] as f, [forms]![Main Acct Details]![ComboActivity] as g;"
  6. DoCmd.RunSQL mySQL
  7.  
  8. DoCmd.RepaintObject acForm, "Main Acct Details"
  9. Forms![Main Acct Details]!ComboActivity = Null
  10.  
  11. End Sub
Dec 12 '06 #5
NeoPa
32,556 Expert Mod 16PB
It can be done.
The basic concept is to link the source data with the table where the newly created records are with a LEFT JOIN and select only those with Null in the latter table in the WHERE clause (or with a filter).
I can't post the code as you haven't posted any MetaData and I don't know what it would be without that.
The answer's here though, just in more general terms.
Dec 12 '06 #6
NeoPa
32,556 Expert Mod 16PB
I'm just checking your code now.
Didn't see it till after I'd posted.
Dec 12 '06 #7
NeoPa
32,556 Expert Mod 16PB
You don't make it easy. Field names help someone reading the code to understand what is what.
Without any clues as to what data you are (or I am) working with, I can only say :
1. You don't seem to be deleting the original record anywhere.
2. DoCmd.SetWarnings should only ever be used in pairs. Clear to run the code then reset it for normal usage (Or you will learn to regret it).
Dec 12 '06 #8
Bface
14
Hi NeoPa,

As you can see I am new at this. The code I posted is not suppose to delete any record. I was hoping you would tell me what code or command would help me do that after the account was inserted into the table. I have to read allot more on this programming stuff. Thanks for your patience.
Dec 12 '06 #9
NeoPa
32,556 Expert Mod 16PB
See post #4.
Without this information I can be little help I'm afraid.
Dec 12 '06 #10

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

Similar topics

1
by: Bo Xu | last post by:
Object of Combination By Bo Xu Introduction A combination of n things, taken s at a time, often referred as an s-combination out of n, is a way to select a subset of size s from a given set of...
134
by: evolnet.regular | last post by:
I've been utilising C for lots of small and a few medium-sized personal projects over the course of the past decade, and I've realised lately just how little progress it's made since then. I've...
1
by: E. Robert Tisdale | last post by:
Please find attached a copy of the "Shape class" example from Bjarne Stroustrup, "The C++ Programming Language: Third Edition", Chapter 2: A Tour of C++, Section 6: Object-Oriented Programming,...
15
by: UrsusMaximus | last post by:
While preparing a Python411 podcast about classes and OOP, my mind wondered far afield. I found myself constructing an extended metaphor or analogy between the way programs are organized and...
4
by: Sreekanth | last post by:
Hi all, I have implemented a timing out version of fgets function call. I am pasting the entire code below. I have following doubts: 1. The code which I have written does it follow standard C...
47
by: Thierry Chappuis | last post by:
Hi, I'm interested in techniques used to program in an object-oriented way using the C ANSI language. I'm studying the GObject library and Laurent Deniau's OOPC framework published on his web...
8
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, I am new to .net technologies. ASP.NET supports socket programming like send/receive in c or c++? I am developing web-site application in asp.net and code behind is Visual C#. In...
139
by: Joe Mayo | last post by:
I think I become more and more alone... Everybody tells me that C++ is better, because once a project becomes very large, I should be happy that it has been written in C++ and not C. I'm the only...
43
by: Adem24 | last post by:
The World Joint Programming Language Standardization Committe (WJPLSC) hereby proclaims to the people of the world that a new programming language is needed for the benefit of the whole mankind in...
151
by: istillshine | last post by:
There are many languages around: C++, JAVA, PASCAL, and so on. I tried to learn C++ and JAVA, but ended up criticizing them. Is it because C was my first programming language? I like C...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.