Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Software and Programs A place where you can share links to Windows applications , Adobe , Microsoft , Rapidshare , Megaupload..

Software and Programs Thread, Access edit data of currently open record in a form in Software & Hardware , Games; I've made a button on a form which, when pressed, adds 1 to one field and adds 7 to another. ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=28290


Reply
LinkBack Thread Tools Display Modes
Access edit data of currently open record in a form
 
 
Senior Member

Reply With Quote
 
Join Date: Dec 2008
Posts: 18,122
12-02-2009, 06:20 PM
 
I've made a button on a form which, when pressed, adds 1 to one field and adds 7 to another. The problem I am having is selecting which record this applies to. I am wanting for the button to apply to the record on display in the form. ...

I've made a button on a form which, when pressed, adds 1 to one field and adds 7 to another.

The problem I am having is selecting which record this applies to.

I am wanting for the button to apply to the record on display in the form.

I've been able to get the number of the current record into a variable lngrecordnum but am unsure how I can use this to select the record I want to edit

Any help is much appreciated. My code is below:

Sub CallMade()
Dim dbs As DAO.Database
Dim rstQuotes As DAO.Recordset
Dim lngrecordnum As Long
Set dbs = CurrentDb
Set rstCustomerQuotes = dbs.OpenRecordset("Quotes Table")

lngrecordnum = Forms![Quotes Table Form].CurrentRecord

'Select which record here

rstQuotes.Edit
rstQuotes!Call_attempt = rstQuotes!Call_attempt + 1
rstQuotes!Priority = rstQuotes!Priority + 7
rstQuotes.Update
End Sub
 
 
 
Reply

Software and Programs Thread, Access edit data of currently open record in a form in Software & Hardware , Games; I've made a button on a form which, when pressed, adds 1 to one field and adds 7 to another. ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=28290


Bookmarks

Tags
access, data, edit, form, open, record


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump