By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,034 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

new to access, but not to visual basic

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.