I've created a button in formA which updates the table in question, but i'd like to have an option to update and open the same record in form2
(different datafields are being entered so i don't think the - DoCmd.openForm "form2", , , "[field]=" & Me.[field]
approach will work).
Is there anyway i can use the .bookmark property to open the new form?
The primary key is autogenerated on update, but as they're not a part of the input(1) or update(2) forms I'd like to avoid using it if possible
24 5041
I've created a button in formA which updates the table in question, but i'd like to have an option to update and open the same record in form2
(different datafields are being entered so i don't think the - DoCmd.openForm "form2", , , "[field]=" & Me.[field]
approach will work).
Is there anyway i can use the .bookmark property to open the new form?
The primary key is autogenerated on update, but as they're not a part of the input(1) or update(2) forms I'd like to avoid using it if possible
Hi!
First of all there is no any reason why DoCmd.OpenForm will not work here.
You can use any field of Form2 Recordsource in DoCmd.OpenForm WhereCondition argument no matter it is bound or not to any control (certainly PK is preferrable).
If you have any special reason not to show the corresponding field on Form1, you can either hide the control bound to the corresponding field or retrieve it's value from Form1 Recordset.
I don't see any problem at all.
Hi!
First of all there is no any reason why DoCmd.OpenForm will not work here.
You can use any field of Form2 Recordsource in DoCmd.OpenForm WhereCondition argument no matter it is bound or not to any control (certainly PK is preferrable).
If you have any special reason not to show the corresponding field on Form1, you can either hide the control bound to the corresponding field or retrieve it's value from Form1 Recordset.
I don't see any problem at all.
When you say retrieve value from recordset, is that to say i can reference a value not explicitly included in form1, provided its a field on the table? And if so can I reference a key which is autofilled on completion of Form1?
When you say retrieve value from recordset, is that to say i can reference a value not explicitly included in form1, provided its a field on the table? And if so can I reference a key which is autofilled on completion of Form1?
Sure.
Something like this (assumed this is in Form1 module), where keyID is the name of PK table field
Sure.
Something like this (assumed this is in Form1 module), where keyID is the name of PK table field
Thats the most helpful thing i've gotten yet! You rock. - Now why does it insist on only applying changes to the First record?
-
Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stLinkCriteria = "Me.LastModified!key = & Forms![Input Form].txtkey"
-
stDocName = "Update"
-
DoCmd.openForm stDocName, , , stLinkCriteria
-
Thats the most helpful thing i've gotten yet! You rock. - Now why does it insist on only applying changes to the First record?
-
Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stLinkCriteria = "Me.LastModified!key = & Forms![Input Form].txtkey"
-
stDocName = "Update"
-
DoCmd.openForm stDocName, , , stLinkCriteria
-
???
What is this code supposed to do?
I mean stLinkCriteria which is completely senseless. It should be a WHERE clause for Form_Update Recordsource.
For example
assumed
- the code opening Form_Update is in Form_Input module
- the name of recordsource table/query field you want to filter by is [Field]
- the [Field] is not bound to any control in Form_Input -
stLinkCriteria = "[Field] = " & Me.Recordset![Field]
-
or -
stLinkCriteria = "[Field] = " & Me![Field]
-
if anyway it is bound to Form_Input field named Field.
???
What is this code supposed to do?
I mean stLinkCriteria which is completely senseless. It should be a WHERE clause for Form_Update Recordsource.
For example
assumed
- the code opening Form_Update is in Form_Input module
- the name of recordsource table/query field you want to filter by is [Field]
- the [Field] is not bound to any control in Form_Input -
stLinkCriteria = "[Field] = " & Me.Recordset![Field]
-
or -
stLinkCriteria = "[Field] = " & Me![Field]
-
if anyway it is bound to Form_Input field named Field.
Well while i am quite sure its rather convoluted at this point, its an attempt at opening a newly added record in a new form. it started out as you have above - but checking that again im getting a .(dot) or !operator or invalid parenthesis error...
Well while i am quite sure its rather convoluted at this point, its an attempt at opening a newly added record in a new form. it started out as you have above - but checking that again im getting a .(dot) or !operator or invalid parenthesis error...
Post the whole sub which opens form "Update", as it looks so far, just to make sure we are mentioning the same.
BTW be aware that while a record is not saved (pencil mark on the record selector) you can't open it in another form. To save the record use -
DoCmd.RunCommand acCmdSaveRecord
-
anywhere before DoCmd.OpenForm command.
heres the sub ATM. im still getting the same error. I added the save command, and have changed my PK from an Autonumber to number, and its control source to =DMAX("key",[tbl Modifications]) + 1.
not that it produced any results per se. -
Private Sub Command85_Click()
-
On Error GoTo Err_Command85_Click
-
With CurrentDb.OpenRecordset("tbl Modifications", dbOpenTable)
-
.AddNew
-
!Program = Me.txtProgram '\
-
!Name = Me.cboName '|
-
!ObjectClass = Me.cboObjectClass
-
!ParentProgram = Me.txtParentProgram
-
!Fund = Me.txtfund
-
!ReportingEntity = Me.txtReportingEntity
-
!PurchaseOrder = Me.txtPurchaseOrder
-
!Comments = Me.txtComments
-
!AppropriationYear = Me.cboAppropriationYear
-
!Site = Me.txtsite
-
!DOR = Me.txtDOR
-
!FiscalYear = Me.cboFiscalYear '|
-
!Description = Me.txtdescription '|
-
!Budget = Me.txtCharge '|
-
!UpdateDate = Date
-
!SSD = Me.txtSSD
-
!CertifiedDocument = Me.objRequest
-
!BCD = Me.txtBCD
-
!FCD = Me.txtFCD
-
!Vendor = Me.txtVendor
-
!key = Me.txtkey
-
.Update
-
.Bookmark = .LastModified
-
End With
-
Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stLinkCriteria = "[txtkey]= " & Me![txtkey]
-
stDocName = "Update"
-
DoCmd.RunCommand acCmdSaveRecord
-
DoCmd.openForm stDocName, , , stLinkCriteria
-
-
-
Exit_Command85_Click:
-
Exit Sub
-
-
Err_Command85_Click:
-
MsgBox Err.Description
-
Resume Exit_Command85_Click
-
-
End Sub
-
edit: I also tried Me.Recordset![txtkey] which had the same result
another edit: stepping through the code, it goes to error on !key = Me....
heres the sub ATM. im still getting the same error. I added the save command, and have changed my PK from an Autonumber to number, and its control source to =DMAX("key",[tbl Modifications]) + 1.
not that it produced any results per se. -
Private Sub Command85_Click()
-
On Error GoTo Err_Command85_Click
-
With CurrentDb.OpenRecordset("tbl Modifications", dbOpenTable)
-
.AddNew
-
!Program = Me.txtProgram '\
-
!Name = Me.cboName '|
-
!ObjectClass = Me.cboObjectClass
-
!ParentProgram = Me.txtParentProgram
-
!Fund = Me.txtfund
-
!ReportingEntity = Me.txtReportingEntity
-
!PurchaseOrder = Me.txtPurchaseOrder
-
!Comments = Me.txtComments
-
!AppropriationYear = Me.cboAppropriationYear
-
!Site = Me.txtsite
-
!DOR = Me.txtDOR
-
!FiscalYear = Me.cboFiscalYear '|
-
!Description = Me.txtdescription '|
-
!Budget = Me.txtCharge '|
-
!UpdateDate = Date
-
!SSD = Me.txtSSD
-
!CertifiedDocument = Me.objRequest
-
!BCD = Me.txtBCD
-
!FCD = Me.txtFCD
-
!Vendor = Me.txtVendor
-
!key = Me.txtkey
-
.Update
-
.Bookmark = .LastModified
-
End With
-
Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stLinkCriteria = "[txtkey]= " & Me![txtkey]
-
stDocName = "Update"
-
DoCmd.RunCommand acCmdSaveRecord
-
DoCmd.openForm stDocName, , , stLinkCriteria
-
-
-
Exit_Command85_Click:
-
Exit Sub
-
-
Err_Command85_Click:
-
MsgBox Err.Description
-
Resume Exit_Command85_Click
-
-
End Sub
-
edit: I also tried Me.Recordset![txtkey] which had the same result
another edit: stepping through the code, it goes to error on !key = Me....
Ok. Its much more cleare now where the legs are growing from.
The problem is so far in record update. The syntax seems to be Ok. Just a silly question concerning this: is the form bound to [tbl Modifications]?
The next one: is form "Update" bound to [tbl Modifications]?
Ok. Its much more cleare now where the legs are growing from.
The problem is so far in record update. The syntax seems to be Ok. Just a silly question concerning this: is the form bound to [tbl Modifications]?
The next one: is form "Update" bound to [tbl Modifications]?
Both tables are indeed bound to [tbl Modifications]. There has been some who question my logic (i don't believe its all that ab-normal hehheh) but for user simplicity's sake im rather stubborn about having two forms. I do have a functioning tabbed form which combines the two, so I could get to work on some other functions in the database, but I hate the d@mn thing.
Both tables are indeed bound to [tbl Modifications]. There has been some who question my logic (i don't believe its all that ab-normal hehheh) but for user simplicity's sake im rather stubborn about having two forms. I do have a functioning tabbed form which combines the two, so I could get to work on some other functions in the database, but I hate the d@mn thing.
speaking of, i went ahead and changed the control source for "txtkey" on the all-inclusive tabbed form to =DMAX("key",[tbl Modifications]) + 1, and now have the same problem. (as it used to be autonumber and there was no need to reference the key on the combined form, this was never an issue).
that being said, it seems to me as though there is a problem with my Dmax syntax...
hoookay, Got some of this worked out, i just changed the update spec to Dmax and voila! (well at first i forgot to change the control source...and maybe there was something else...)
that being said, the second form still insists on updating the first record. It is of course friendly enough to change the key value to corrispond with the first form - thus creating duplicates and leading me to believe the problem is either still here: - Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stLinkCriteria = "[txtkey]= me.txtkey"
-
stDocName = "Update"
-
DoCmd.RunCommand acCmdSaveRecord
-
DoCmd.openForm stDocName, , , stLinkCriteria
-
or perhaps on the second form here: - With CurrentDb.OpenRecordset("tbl modifications") '===>i deleted dbopentable - did nothing
-
-
.Edit
-
!key = DMax("[key]", "[tbl Modifications]")
-
!UpdateDate = Date
-
!Mod = Me.txtMOD
-
!MRD = Me.txtMRD
-
!SLD = Me.txtSLD
-
!SCD = Me.txtSCD
-
!OSD = Me.txtOSD
-
!ObligationDocument = Me.objObligationDocument
-
-
.Update
-
.Bookmark = .LastModified
-
End With
edit:i changed !key to = Me.txtkey, it then proceeded to update the same record, which oddly was no longer the first record but the second to last(the first of two 201's), gave it a null value, and moved it back to the top. The Implications of this are beyond my current comprehension (though they perhaps support hypothesis that the problem lies in the second form?)
Both tables are indeed bound to [tbl Modifications]. There has been some who question my logic (i don't believe its all that ab-normal hehheh) but for user simplicity's sake im rather stubborn about having two forms. I do have a functioning tabbed form which combines the two, so I could get to work on some other functions in the database, but I hate the d@mn thing.
Really!?
Form RecordSource property is set to [tbl Modifications] and form fields ControlSource properties are set to [tbl Modifications] corresponding fields??!! Let me know whether is it really so.
If so why you update [tbl Modifications] programmatically. It will do nothing in "Update" form and cause record duplication in "Input" form, which in its turn will cause PK violation error on [tbl Modifications].key writing.
*very embaressed
Really!?
Form RecordSource property is set to [tbl Modifications] and form fields ControlSource properties are set to [tbl Modifications] corresponding fields??!! Let me know whether is it really so.
If so why you update [tbl Modifications] programmatically. It will do nothing in "Update" form and cause record duplication in "Input" form, which in its turn will cause PK violation error on [tbl Modifications].key writing.
I don't(edit:do) think that the control source properties are set to fields in [tbl Modifications] (actually "txtkey" might be if what im doing in VB is setting control sources which as i type this begins to seem more likely) - 'in form1
-
!key = DMax("[key]", "[tbl Modifications]") + 1
- 'in form2
-
!key = DMax("[key]", "[tbl Modifications]")
So in response to your 1st question: maybe?(edit:in response to your only question: yes)
Form1(imput) successfully adds a new record but as you said (well the inverse), Form2(update) duplicates the PK value. How can I get form2 to edit the record from Form1 without referencing the PK? Barring the sloppy thinking you've just pointed out I had been thinking my problem was in Form2 here: - With CurrentDb.OpenRecordset("tbl Modifications", dbOpenTable)
edit:one last bit, in access form1(+2)>txtkey>Properties>control source = unbound, in case thats what you're asking about.
*very embaressed
I don't(edit:do) think that the control source properties are set to fields in [tbl Modifications] (actually "txtkey" might be if what im doing in VB is setting control sources which as i type this begins to seem more likely) - 'in form1
-
!key = DMax("[key]", "[tbl Modifications]") + 1
- 'in form2
-
!key = DMax("[key]", "[tbl Modifications]")
So in response to your 1st question: maybe?(edit:in response to your only question: yes)
Form1(imput) successfully adds a new record but as you said (well the inverse), Form2(update) duplicates the PK value. How can I get form2 to edit the record from Form1 without referencing the PK? Barring the sloppy thinking you've just pointed out I had been thinking my problem was in Form2 here: - With CurrentDb.OpenRecordset("tbl Modifications", dbOpenTable)
I've meant form and form fields properties set when form was created or modified in Design view.
Open form (each form) in Design view and check whether form RecordSource property is set to [tbl Modifications] and form fields ControlSource properties are set to corresponding [tbl Modifications] fields.
If so record duplication actually occurs in "Input" form. When you start editing new record form automation creates new record, then your code do the same -
With CurrentDB.OpenRecordset.....
-
.AddNew
-
.........
-
.Update
-
End With
-
P.S. I have to go now, will be back in 4-5 hours.
I've meant form and form fields properties set when form was created or modified in Design view.
Open form (each form) in Design view and check whether form RecordSource property is set to [tbl Modifications] and form fields ControlSource properties are set to corresponding [tbl Modifications] fields.
ok those are definately unbound. im pretty sure that the problem is that my editrecordButton on Form2 is copied pretty directly from the original addrecordButton on Form1 - i just changed .addnew to .edit - Private Private Sub comRecord_Click()
-
Dim temp As Variant
-
On Error GoTo Err_comRecord_Click
-
-
temp = SysCmd(acSysCmdSetStatus, "Filling table...")
-
- With CurrentDb.OpenRecordset("tbl Modifications", dbOpenTable)
-
.Edit
-
!key = DMax("[key]", "[tbl Modifications]")
-
!UpdateDate = Date
-
!Mod = Me.txtMOD
-
!MRD = Me.txtMRD
-
!SLD = Me.txtSLD
-
!SCD = Me.txtSCD
-
!OSD = Me.txtOSD
-
!ObligationDocument = Me.objObligationDocument
-
-
.Update
-
.Bookmark = .LastModified
-
End With
-
-
temp = SysCmd(acSysCmdClearStatus)
-
-
Exit_comRecord_Click:
-
Exit Sub
-
-
Err_comRecord_Click:
-
MsgBox Err.Description
-
Resume Exit_comRecord_Click
-
-
End Sub
Im going to look into this recordset business...
ok those are definately unbound. im pretty sure that the problem is that my editrecordButton on Form2 is copied pretty directly from the original addrecordButton on Form1 - i just changed .addnew to .edit - Private Private Sub comRecord_Click()
-
Dim temp As Variant
-
On Error GoTo Err_comRecord_Click
-
-
temp = SysCmd(acSysCmdSetStatus, "Filling table...")
-
- With CurrentDb.OpenRecordset("tbl Modifications", dbOpenTable)
-
.Edit
-
!key = DMax("[key]", "[tbl Modifications]")
-
!UpdateDate = Date
-
!Mod = Me.txtMOD
-
!MRD = Me.txtMRD
-
!SLD = Me.txtSLD
-
!SCD = Me.txtSCD
-
!OSD = Me.txtOSD
-
!ObligationDocument = Me.objObligationDocument
-
-
.Update
-
.Bookmark = .LastModified
-
End With
-
-
temp = SysCmd(acSysCmdClearStatus)
-
-
Exit_comRecord_Click:
-
Exit Sub
-
-
Err_comRecord_Click:
-
MsgBox Err.Description
-
Resume Exit_comRecord_Click
-
-
End Sub
Im going to look into this recordset business...
Code for record updating and, I'm pretty sure, there is also code for fields populating. Usually its better to let Access do it via bound form automation.
Why not to bind Form2 (maybe Form1 too, but Form2 definitely should be bound) to [tbl Modifications] and let Access do this behind the scenes?
BTW DoCmd.OpenForm with WhereCondition argument is indeed useless on unbound form.
Code for record updating and, I'm pretty sure, there is also code for fields populating. Usually its better to let Access do it via bound form automation.
Why not to bind Form2 (maybe Form1 too, but Form2 definitely should be bound) to [tbl Modifications] and let Access do this behind the scenes?
BTW DoCmd.OpenForm with WhereCondition argument is indeed useless on unbound form.
I just found a seldom used 'ammendment number' that will soon become manditory now that i can identify the records without the autonumber/dmax (procurement request + amendment number => PR + Mod # =yay!). I'm hoping with that it will be easier to reopen a record in a new form now that i wont be referencing calculated fields.... now if i could only find those postings on linking with multiple criteria....I'll be back just as soon as im in deep water again.
ps: SQL czars, gurus, etc beware - if things go well you're next
Ok so form two was indeed unbound, a problem which has been addressed.
this didnt work: - Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stDocName = "Update"
-
-
stLinkCriteria = "[txtkey]=" & Me!txtkey
-
DoCmd.openForm stDocName, , , stLinkCriteria
which leads to "syntax error (missing operator) in query expression '[txtkey]='
so i tried this approach: - DoCmd.openForm "Update"
-
-
Forms!Update!txtkey.SetFocus
-
-
DoCmd.FindRecord Forms![Input Form]!txtkey
which gives me "An expression you entered is the wrong data type for one of the arguements" (goes to error on last line)
any ideas?
Ok so form two was indeed unbound, a problem which has been addressed.
this didnt work: - Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stDocName = "Update"
-
-
stLinkCriteria = "[txtkey]=" & Me!txtkey
-
DoCmd.openForm stDocName, , , stLinkCriteria
which leads to "syntax error (missing operator) in query expression '[txtkey]='
so i tried this approach: - DoCmd.openForm "Update"
-
-
Forms!Update!txtkey.SetFocus
-
-
DoCmd.FindRecord Forms![Input Form]!txtkey
which gives me "An expression you entered is the wrong data type for one of the arguements" (goes to error on last line)
any ideas?
Change the first code to this. WhereCondition argument in DoCmd.OpenForm has to have name of table field to the left of '=' not name of form control. - Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stDocName = "Update"
-
-
stLinkCriteria = "key=" & Me!txtkey
-
DoCmd.openForm stDocName, , , stLinkCriteria
this: - Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stDocName = "Update"
-
-
stLinkCriteria = "![keyID]=" & Me!txtkey
-
DoCmd.openForm stDocName, , , stLinkCriteria
gives me a 'syntax error'
this: - DoCmd.openForm "Update", acNormal, , "!keyID='" & Me![txtkey] & "'", acFormEdit, acWindowNormal
prompts me for a parameter value for keyID
this (stolen from another of your posts): - Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stDocName = "Update"
-
stLinkCriteria = "[keyID]=" & "'" & Me![txtkey] & "'"
-
-
With DoCmd
-
.RunCommand acCmdSaveRecord
-
.openForm stDocName, , , stLinkCriteria
-
End With
-
-
Forms![Update]![txtkey].DefaultValue = Me![txtkey]
says command or action saverecord is unavailable.
when put in this: -
Private Sub Command85_Click()
-
-
On Error GoTo Err_Command85_Click
-
-
With CurrentDb.OpenRecordset("tbl Modifications", dbOpenTable)
-
.AddNew
-
!Program = Me.txtProgram '\
-
!Name = Me.cboName '|
-
!ObjectClass = Me.cboObjectClass
-
!ParentProgram = Me.txtParentProgram
-
!Fund = Me.txtfund
-
!ReportingEntity = Me.txtReportingEntity
-
!PurchaseOrder = Me.txtPurchaseOrder
-
!Comments = Me.txtComments
-
!AppropriationYear = Me.cboAppropriationYear
-
!Site = Me.txtsite
-
!DOR = Me.txtDOR
-
!FiscalYear = Me.cboFiscalYear '|
-
!Description = Me.txtdescription '|
-
!Budget = Me.txtCharge '|
-
!UpdateDate = Date
-
!SSD = Me.txtSSD
-
!CertifiedDocument = Me.objRequest
-
!BCD = Me.txtBCD
-
!FCD = Me.txtFCD
-
!Vendor = Me.txtVendor
-
!Amendment = Me.txtAmendment
-
-
.Update
-
.Bookmark = .LastModified
-
-
End With
-
-
Exit_Command85_Click:
-
Exit Sub
-
-
Err_Command85_Click:
-
MsgBox Err.Description
-
Resume Exit_Command85_Click
-
-
End Sub
this: - Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stDocName = "Update"
-
-
stLinkCriteria = "![keyID]=" & Me!txtkey
-
DoCmd.openForm stDocName, , , stLinkCriteria
gives me a 'syntax error'
this: - DoCmd.openForm "Update", acNormal, , "!keyID='" & Me![txtkey] & "'", acFormEdit, acWindowNormal
prompts me for a parameter value for keyID
this (stolen from another of your posts): - Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stDocName = "Update"
-
stLinkCriteria = "[keyID]=" & "'" & Me![txtkey] & "'"
-
-
With DoCmd
-
.RunCommand acCmdSaveRecord
-
.openForm stDocName, , , stLinkCriteria
-
End With
-
-
Forms![Update]![txtkey].DefaultValue = Me![txtkey]
says command or action saverecord is unavailable.
when put in this: -
Private Sub Command85_Click()
-
-
On Error GoTo Err_Command85_Click
-
-
With CurrentDb.OpenRecordset("tbl Modifications", dbOpenTable)
-
.AddNew
-
!Program = Me.txtProgram '\
-
!Name = Me.cboName '|
-
!ObjectClass = Me.cboObjectClass
-
!ParentProgram = Me.txtParentProgram
-
!Fund = Me.txtfund
-
!ReportingEntity = Me.txtReportingEntity
-
!PurchaseOrder = Me.txtPurchaseOrder
-
!Comments = Me.txtComments
-
!AppropriationYear = Me.cboAppropriationYear
-
!Site = Me.txtsite
-
!DOR = Me.txtDOR
-
!FiscalYear = Me.cboFiscalYear '|
-
!Description = Me.txtdescription '|
-
!Budget = Me.txtCharge '|
-
!UpdateDate = Date
-
!SSD = Me.txtSSD
-
!CertifiedDocument = Me.objRequest
-
!BCD = Me.txtBCD
-
!FCD = Me.txtFCD
-
!Vendor = Me.txtVendor
-
!Amendment = Me.txtAmendment
-
-
.Update
-
.Bookmark = .LastModified
-
-
End With
-
-
Exit_Command85_Click:
-
Exit Sub
-
-
Err_Command85_Click:
-
MsgBox Err.Description
-
Resume Exit_Command85_Click
-
-
End Sub
Post [tbl Modifications] metadata. Example given below.
Here is an example of how to post table MetaData : Table Name=tblStudent - Field; Type; IndexInfo
-
StudentID; AutoNumber; PK
-
Family; String; FK
-
Name; String
-
University; String; FK
-
Mark; Numeric
-
LastAttendance; Date/Time
I figured much of my problems out, partially a bound form thing, partially through a different approach.
Form1 opens an existing blank record, which it edits, "saves", and opens in a new form. It then closes and generates a new blank for when it opens next.
heres the problem: Values inputed on Form1 fail to save, automatically or even when instructed. my code follows...
from the pulldown menu: - Sub openForm()
-
DoCmd.openForm "Input Form", acNormal, , "[EntryStatus] = 0", acFormEdit, acWindowNormal
-
End Subon
click event: - With DoCmd
-
-
.RunCommand acCmdSaveRecord
-
-
.RunSQL "UPDATE [tbl Modifications] SET [EntryStatus]=(1) WHERE [keyID]= [txtkey]"
-
-
.openForm "Update", acNormal, , "[keyID]=" & Me!txtkey, acFormEdit, acWindowNormal
-
-
.Close acForm, Me.Name
-
-
End With
onclose: - Private Sub Form_Close()
-
-
-
With CurrentDb.OpenRecordset("tbl Modifications", dbOpenTable)
-
.AddNew
-
!EntryStatus = 0
-
.Update
-
End With
-
-
End Sub
got this one. my controls were still unbound. oops.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Sue Adams |
last post by:
I actually have two issues/questions:
I have an autonumber field in an access db table that I grab and later use to update a record in another table withing the same db.
The code I use to get...
|
by: Dom Boyce |
last post by:
Hi
First up, I am using MS Access 2002.
I have a database which records analyst rating changes for a list of
companies on a daily basis. Unfortunately, the database has been set
up (by my...
|
by: Jonathan Upright |
last post by:
Greetings to anyone who can help:
I'm using WebMatrix to make ASP.NET pages, and I chose the "Editable
DataGrid" at the project selector screen. As you may know, it defaults
to the Microsoft...
|
by: mursyidatun ismail |
last post by:
Dear all,
database use: Ms Access.
platform: .Net
i'm trying to update a record/records in a table called t_doctors by
clicking da edit link provided in the database.
when i ran through da...
|
by: Mark Reed |
last post by:
Hi All,
I'm having a problem with the following code. I've read quite a lot of
old posts regarding the issue but none seem to affer a solution.
The scenario is. I have a bound form which...
|
by: Stephen Plotnick |
last post by:
I'm very new to VB.NET 2003
Here is what I have accomplished:
MainSelectForm - Selects an item
In a public class I pass a DataViewRow to
ItemInformation1 Form
ItemInformation2 Form
|
by: mtgrizzly52 |
last post by:
Hi all,
I've looked for an answer for this in lots of books, online in several discussion groups and have not found the answer which I feel may be very simple.
What I want to do is have a...
|
by: Access Programming only with macros, no code |
last post by:
ERROR MESSAGE:
Could not update; currently locked by another session on this
machine.
BACKGROUND
I have the following objects:
Table1 - HO (which has about 51,000+ records)
Table2 -...
|
by: teenagelcruise |
last post by:
hi,
i have a problem with my code which is i cannot update and addnew data into the database but i can delete the data.plz give me an idea.this is my code that i wrote.
<html>
<head>
<meta...
|
by: sirdavethebrave |
last post by:
Hi guys -
I have written a form, and a stored procedure to update the said form.
It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |