473,386 Members | 1,886 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,386 software developers and data experts.

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 1826
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********@yahoo.com (Volumstein) wrote in message news:<7d**************************@posting.google. 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********@yahoo.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="update 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.public.access.gettingstarted that
is just for people getting started with Access. There are several
microsoft.public.access.YourInterest 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 "normalization" 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********@yahoo.com> wrote in message
news:7d**************************@posting.google.c om...
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
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...
11
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...
6
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...
6
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...
0
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...
5
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...
1
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...
4
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...
2
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...
6
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.