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

Home Posts Topics Members FAQ

new to access, but not to visual basic

Hello,
I am spoiled coming from programming in word and excel which
offer the "record macro" tool that eliminated most basic syntax
confusions that I had. unfortunately msaccess doesn't offer that
option, and my luck in the groups has yielded little results for
manipulating tables via vb code in a form. Could anyone illustrate a
few examples for me?
1.) How would I Modify a specific cell in a table called "Mytable?"
And if possible could you show me two examples. one from inside an
Access form in the current project and one from "outside" (no current
project) of Access?

2.) What is the syntax for refreshing an open form?

3.) And how would I delete an entire column or row from a table?

Any direct help or reference of-course recieves a thanks in advance.

Thanks,
bp
Nov 13 '05 #1
4 1852
I think the best thing you could do is actually just to play around for a
couple of hours making a little database (or copying one from somewhere).
This will answer all of the questions below.

Hello,
I am spoiled coming from programming in word and excel which
offer the "record macro" tool that eliminated most basic syntax
confusions that I had. unfortunately msaccess doesn't offer that
option, and my luck in the groups has yielded little results for
manipulating tables via vb code in a form. Could anyone illustrate a
few examples for me?
1.) How would I Modify a specific cell in a table called "Mytable?"
And if possible could you show me two examples. one from inside an
Access form in the current project and one from "outside" (no current
project) of Access?

OPEN THE TABLE AND EDIT IT AS YOU PLEASE OR USE SQL (QUERIES TO CHANGE IT)

2.) What is the syntax for refreshing an open form?
ME.REQUERY FROM VISUAL BASIC,

3.) And how would I delete an entire column or row from a table?

GO INTO THE TABLE DESIGN AND JUST DELETE IT.

Any direct help or reference of-course recieves a thanks in advance.

Thanks,
bp
Nov 13 '05 #2
vo********@yaho o.com (Volumstein) wrote in message news:<7d******* *************** ****@posting.go ogle.com>...
Hello,
I am spoiled coming from programming in word and excel which
offer the "record macro" tool that eliminated most basic syntax
confusions that I had. unfortunately msaccess doesn't offer that
option, and my luck in the groups has yielded little results for
manipulating tables via vb code in a form. Could anyone illustrate a
few examples for me?
1.) How would I Modify a specific cell in a table called "Mytable?"
Oooh... ready for a serious paradigm shift? rows in Excel are
_ordered_. rows in a database table are NOT ordered. So moving from
"record 1" to "record 2" will depend on the sort order of the table
(usually determined by the indexing). So, to modify a specific "cell"
(or field within a record), you would (1) go to the record in question
or filter for it; and (2) put the recordset in edit mode, (3) make
changes to fields/columns in the record (4) save your changes by
issuing an Update. Look up "recordset" and probably "update" in help.

Normally, you change data by running update queries...
And if possible could you show me two examples. one from inside an
Access form in the current project and one from "outside" (no current
project) of Access?

2.) What is the syntax for refreshing an open form? Me.Refresh
3.) And how would I delete an entire column or row from a table? use an update query.

delete a column (set all values to null)
UPDATE MyTable
SET MyField=NULL;

delete a row
DELETE
FROM MyTable
WHERE ID=1;
Any direct help or reference of-course recieves a thanks in advance.

Thanks,
bp

Nov 13 '05 #3
In message <7d************ **************@ posting.google. com>, Volumstein
<vo********@yah oo.com> writes
Hello,
I am spoiled coming from programming in word and excel which
offer the "record macro" tool that eliminated most basic syntax
confusions that I had. unfortunately msaccess doesn't offer that
option, and my luck in the groups has yielded little results for
manipulating tables via vb code in a form. Could anyone illustrate a
few examples for me?
1.) How would I Modify a specific cell in a table called "Mytable?"
And if possible could you show me two examples. one from inside an
Access form in the current project and one from "outside" (no current
project) of Access?
There are two different ways of updating data. You could create an
update query using the GUI and then invoke it from the code,

DoCmd.OpenQuery "MyQuery"
Alternatively you can create SQL code and execute that, for instance.

CmdString="upda te Mytable set somefield=3 where otherfield=1;"

DoCmd.RunSQL CmdString


2.) What is the syntax for refreshing an open form?

3.) And how would I delete an entire column or row from a table?


Deleting a row can also be done with a query or in SQL. I have never
seen a situation where I would want to delete an entire column. That's
usually only done at design time.


--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #4
While the people who lurk this newsgroup are pretty generous with their time
and expertise there is a group; microsoft.publi c.access.gettin gstarted that
is just for people getting started with Access. There are several
microsoft.publi c.access.YourIn terest groups.

It is recommended that you post a request for the solution to a single
technical problem you're trying to solve rather than omnibus "please teach
me Access" kinds of posts.

People are more than willing to help others who are making an effort to
solve their own problems and who have run into a brick wall.

If you are unfamiliar with Access and also unfamiliar with relational
databases you'll have kind of a steep learning curve ahead of you. Once you
break through it it will all be worth while. There are lots of books that
could help you make the transition. You are fortunate that you are already
a programmer of VB. It's the core language of all the MS Office apps. Lurk
your closest Barnes & Noble or Borders bookstore and look for Access for
Dummies (no slur intended), Beginning Access [yourversion] VBA by Smith and
Sussman, Access [yourversion] Step by Step from Microsoft Press. There are
others ...

Just as the object models are more of a chore than VBA in Word and Excel,
the same is true in Access.

Yep, Access doesn't provide a "record macro" function. In fact, I recommend
that you decide early on to avoid the use of Macros in Access as much as you
can. In the other Office applications, macro just means VBA code. In
Access there is a whole different paradigm of coding called Macro.

Read some books. Understand what "normalizat ion" is all about. Later
you'll understand why normalization is so important. Lurk the newsgroups
and learn from the questions others are posting and answering. Another
extremely valuable resource is www.mvps.org/access It has lots of Access
lore and links to other useful sites.

See some responses inline with your post below.

HTH
--
-Larry-
--

"Volumstein " <vo********@yah oo.com> wrote in message
news:7d******** *************** ***@posting.goo gle.com...
Hello,
I am spoiled coming from programming in word and excel which
offer the "record macro" tool that eliminated most basic syntax
confusions that I had. unfortunately msaccess doesn't offer that
option, and my luck in the groups has yielded little results for
manipulating tables via vb code in a form. Could anyone illustrate a
few examples for me?
1.) How would I Modify a specific cell in a table called "Mytable?"
And if possible could you show me two examples. one from inside an
Access form in the current project
It isn't a "cell", it's a "Field". In the textbox in your form which
displays the content of that field, change the value. When the record is
saved the new value is stored in the table.

and one from "outside" (no current project) of Access?
No
2.) What is the syntax for refreshing an open form?
Me.Refresh
3.) And how would I delete an entire column or row from a table?
Click the record selector on the left side of your form and then hit the
Delete key. Usually you'll just be asked if you really want to delete the
record and you'll indicate you do and will succeed but this record may be
participating in relationships and that's something else. :-)

Any direct help or reference of-course recieves a thanks in advance.

Thanks,
bp

Nov 13 '05 #5

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

Similar topics

8
5670
by: delete table with Visual Basic 6 | last post by:
Dear developer, I have an error message when I try to delete or drop Microsoft Access XP table with ADOX in Visual Basic 6. I use the ADOX.Catalog and ADOX.table to create and delete or drop table within Visual Basic program. If anybody knows how to solve the problem, please give me the solution. I would like to thank you for your attention and response. Best regard, Sanad
11
5217
by: Robert | last post by:
Would you use Access to create a car rental reservation system? I would think that the complexity of such a system would be better suited to a procedural language like Visual Basic or C++. Your thoughts, please. Robert
6
4739
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
6
3665
by: Terry Bell | last post by:
We've had a very large A97 app running fine for the last seven years. I've just converted to SQL Server backend, which is being tested, but meanwhile the JET based version, running under terminal server, has suddenly started running very slowly. The network engineer has thrown up his hands and said "It's Access 97". I've checked out lots of things including the Oplocks setting and other stuff from this NG, and I think I've done everything...
0
2822
by: M | last post by:
I installed the Visual Basic .NET Resource Kit. When I click 'Visual Basic .NET Resource Kit' the page at 'http://localhost/VB.NETResourceKit/Welcome.aspx' show: Server Error in '/VB.NETResourceKit' Application. ----------------------------------------------------------- --------------------- Server cannot access application directory 'D:\Program
5
2681
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callnetfrcom.asp The Joy of Interoperability Sometimes a revolution in programming forces you to abandon all that's come before. To take an extreme example, suppose you have been writing Visual Basic applications for years now. If you're like many developers, you will have built up a substantial inventory of code in that time. And if you've been following...
1
2017
by: Nikhil | last post by:
Hi, I have defined a module called "Utility Functions" in MS-Access. In that module, I have defined a function called NullToZero. I used this function in one of my stored Queries in Access. This works fine when I run the query in Access itself. Now, when I call the query from Visual Basic through an OleDbCommand and an OleDbConnection, I get the exception: "undefined function in expression" Is there a special way to call Modules in...
4
2026
by: RICHARD BROMBERG | last post by:
I am writing an application ising Access 2000. I bought a copy of Microsoft Office 2000 Developer Edition so I could compile a distribute an executable copy of my application. I also have MS Visual Basic Professional installed. And I have Microsoft Office 2000 Premium installed. The following message comes up while I am installing Microsoft Office 2000 Developer Edition: "Microsoft Office 2000 Developer requires Visual Basic for...
2
2079
by: CAM | last post by:
Hello, I am wondering if someone can give me some pointers. Currently I am using Access 2002 I developed an inventory tracking database, which this database is used in California and in Florida. Unfortunaley Access is not very good as an enterprise wide database, accessing the data from one side of the United States to the other its so slow. About 5 years ago I developed a database using Visual Basic 6 as the front end and Crystal...
6
1939
by: JonC | last post by:
I am developing an Access database and need to be able to print a form with various selections made as it appears on screen. The standard way of doing this would be to create a report based on the form but the form is quite complex with nested subforms and page tabs and trying to filter the records is proving to be a nightmare. I'm sure there must be some VB code that could do this for me but I'm a bit of a novice. Printing the screen...
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
8339
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
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8629
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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.