Record Disappears.

Mar 21, 2005

I've created a form and when i create a user it goes through without a problem. However when i try to create another user, my code somehow deletes the last record. Where am i going wrong?

Code:Option Compare DatabaseOption ExplicitPublic s As StringPublic Check1 As StringPrivate Sub cmboSC_ID_AfterUpdate()Me.txtSC_ID = cmboSC_ID.Column(0)Me.txtSC_NAME = cmboSC_ID.Column(1)Me.txtSC_PASSWORD = cmboSC_ID.Column(2)Me.txtSC_LEVEL = cmboSC_ID.Column(3)Me.txtSC_PROGRAM = cmboSC_ID.Column(4)If Check1 = "DEL" ThenElseCheck1 = "MOD"End IfMe.txtSC_ID.Visible = TrueMe.txtSC_ID.SetFocusMe.cmboSC_ID.Visible = FalseMe.cmboSC_ID = "" Me.cmdUpdateADO.Enabled = TrueEnd SubPrivate Sub cmboSC_ID_GotFocus()cmboSC_ID.RequerycmboSC_ID.DropdownEnd Sub Private Sub cmdClear_Click()Check1 = ""Me.txtSC_ID = ""Me.txtSC_NAME = ""Me.txtSC_PASSWORD = ""Me.txtSC_LEVEL = ""Me.txtSC_PROGRAM = ""Me.txtSC_ID.Visible = TrueMe.txtSC_ID.SetFocusMe.cmboSC_ID.Visible = FalseMe.cmdDel.Enabled = TrueMe.cmdUpdateADO.Enabled = FalseEnd SubPrivate Sub cmdClose_Click()DoCmd.CloseEnd SubPrivate Sub cmdUpdateADO_Click()On Error GoTo ADOErrhandlerDim ADOrs As ADODB.RecordsetDim sSQL As String 'sSQL = "Select * from tblSecurity;" 'Set rsADO = New ADODB.Recordset'rsADO.Open sSQL, CurrentProject.Connection, adOpenKeyset, adLockBatchOptimisticIf Check1 = "ADD" ThensSQL = "tblSecurity"Set ADOrs = New ADODB.RecordsetADOrs.Open sSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimisticWith ADOrs .Fields("SC_ID") = Me.txtSC_ID.Fields("SC_Name") = Me.txtSC_NAME.Fields("SC_Password") = Me.txtSC_PASSWORD.Fields("SC_Level") = Me.txtSC_LEVEL.Fields("SC_Program") = Me.txtSC_PROGRAM.UpdateEnd WithSet ADOrs = NothingMsgBox Me.txtSC_NAME & " Added" ElseIf Check1 = "MOD" ThensSQL = "Select * from tblSecurity where tblSecurity.SC_ID = '" & txtSC_ID & "';"Set ADOrs = New ADODB.RecordsetADOrs.Open sSQL, CurrentProject.Connection, adOpenDynamic, adLockOptimisticWith ADOrs .Fields("SC_ID") = Me.txtSC_ID.Fields("SC_Name") = Me.txtSC_NAME.Fields("SC_Password") = Me.txtSC_PASSWORD.Fields("SC_Level") = Me.txtSC_LEVEL.Fields("SC_Program") = Me.txtSC_PROGRAM.UpdateEnd WithSet ADOrs = NothingMsgBox Me.txtSC_NAME & " Edited" ElseIf Check1 = "DEL" Then sSQL = "Select * from tblSecurity where tblSecurity.SC_ID = '" & txtSC_ID & "';"Set ADOrs = New ADODB.RecordsetADOrs.Open sSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic ADOrs.DeleteSet ADOrs = NothingMsgBox Me.txtSC_NAME & " Deleted"ElseMsgBox "An Error Occurred. The system doesn't know which action to take"End IfSet ADOrs = NothingCall cmdClear_ClickExit SubADOErrhandler:Select Case Err.Number Case ElseMsgBox Err.Number & vbCrLf & Err.DescriptionEnd Select End SubPrivate Sub txtSC_ID_AfterUpdate()Dim DAOdb As DatabaseDim DAOrs As DAO.RecordsetDim sSQL As StringDim s As StringSet DAOdb = CurrentDb()s = "Select * from tblSecurity where tblSecurity.SC_ID = '" & txtSC_ID & "';"Set DAOrs = DAOdb.OpenRecordset(s)If DAOrs.EOF Then'New recordCheck1 = "ADD"txtSC_ID.SetFocusElse'Exisitng RecordMe.txtSC_ID = DAOrs("SC_ID")Me.txtSC_NAME = DAOrs("Sc_Name")Me.txtSC_PASSWORD = DAOrs("SC_Password")Me.txtSC_LEVEL = DAOrs("SC_Level")Me.txtSC_PROGRAM = DAOrs("SC_Program")Check1 = "MOD"End IfDAOrs.CloseDAOdb.CloseMe.cmdUpdateADO.Enabled = TrueEnd SubPrivate Sub txtSC_ID_DblClick(Cancel As Integer)Call cmdClear_ClickMe.cmboSC_ID.Visible = TrueMe.cmboSC_ID.SetFocusMe.txtSC_ID.Visible = False End SubPrivate Sub cmdDel_Click()Call cmdClear_ClickMe.cmboSC_ID.Visible = TrueMe.cmboSC_ID.SetFocusMe.txtSC_ID.Visible = FalseCheck1 = "DEL"End Sub

Thanks...
eddiemm3

View Replies


ADVERTISEMENT

Subform Disappears???

Oct 19, 2005

I created a database which was working well. I then added my data and it still seemed to be working well. Since then I have made quite a few other changes, but only to queries realting to the subform.

When I cycle through my main records the subform shows and displays all the info. But when I get to the end to add a new record, the subform disappears.

Any ideas as to what I've done?

Thanks

View 14 Replies View Related

Data 'disappears' From My Database

Apr 23, 2007

I inherited this database and I can't figure this out so I'm looking for some causes.

the database is in one .mdb file, the interface in another and links to the database via the linked table manager.

The tables aren't normalized, nor was there any attempt at relational integrity (Strike 1). Thats obvious

But what isn't so obvious is that data in fields just disappears, it'll get entered, verified and a couple weeks/months later, its just gone and no one claims responsibility for taking it out (and in 99% of cases, we wouldn't)

It is a multi user database but there are only 10 people in the office and I doubt more than 3 are ever connected at once. And most of the time is only one of us at a time based on our schedules.

Anyone have any ideas? I'm going to advise the bosses that we take the time to start over with sql server, normalize the tables and take better care of developing the forms (in .net)

View 3 Replies View Related

Embedded Ole Object Disappears

Jun 28, 2007

In the form view of the db I have a bound box for an embedded ole object
I use it to embed Word documents for each db entry (The database is for works of art and the Word document is the description of each work of art which often contains Chinese Characters, hence the Word Document)

The box is set to show an icon (The Word Icon)
Upon entering the data and moving off the record, subsequent return to to the record sometimes shows that the icon is gone from the box, it is blank.
Clicking the blank box brings up the Word Document but then closing the Word Document and re-clicking the blank box dos not bring up the Word Document.
The standard message saying that the ole object is empty appears and all the data from the Word Document is lost.

this has only happened since moving to Office 2007. I upgraded the db to 2007 format and we are using Word 2007.

A Google of the symptoms doesn't bring any meaningful results, does anyone have any ideas?

I tried to keep this as short as possible (which wasn't easy) if you need more info just ask

Thanks

View 3 Replies View Related

Calculated Field Disappears...

Jan 27, 2005

I have a calculated field in a form that calculates the amount due. When I open the form or the record and the record has an amount due of 0, then the field says "$0.00" for a second and then disappears. Any idea why this is so? This becomes a problem because $0.00 doesn't appear on any reports either. Any help would be appreciated!

View 7 Replies View Related

Forms :: Form Disappears When Set To Pop Up

Aug 7, 2014

In Access 2010, I can't get a form to show up in Pop Up mode without it disappearing. Tried several solutions (most from this message board) with no luck, including:

Set Modal = no
Set Auto Resize = no
Set Auto Center = no
Set Border Style = dialog

There isn't any VBA set to run when the form opens, only on button clicks.I'm able to call out the form to open as acDialog in vba, but this blocks additional code I need to prepopulate the form.So far this happens on all forms I try to set as Pop Up.

View 14 Replies View Related

Default Value Disappears For Prim Key Field

Mar 16, 2006

Hello,
MS Access 2000 sp3
When adding a new record to an order file, I have a default value on the ordnum field. It also has a format = "9999-999". The default value is "0603-".
When the user clicks on the new rec nav button, the form has the correct default in the ordnum field "0603-". However, when the user trys to key in the remaining 3 digit sequence number (.i.e. result 0603-123), the default value disappears as soon as the use startes to type the first character. The table source is a query that links the order table to the customer table via cust num. When i use only the order table as the form source, this works ok, no issues but i see this issue when i am using a query joining two tables.
Does anyone have any ideas why or how I can correct this?
Thanks!!
zip file attached with test database

View 3 Replies View Related

Arrgghh Now It Disappears In Form View!

Jun 28, 2006

I am making up how to create a database as I go along so I am sure some of the techniques I have used are a bit unconventional! However, I wanted to use data from 2 different tables as control sources, so changed the record source to a query that combined the two tables. I thought this was correct as I could then apply control sources from both tables to fields.

However, now when I click out of design view and into form view, the form/database dissapears. Does anyone know why & how I could resolve this?

Thanks!

View 1 Replies View Related

Forms :: Subform Disappears If There Is No Data

Jun 24, 2013

I am using Access 2010.

Whenever I come to a record that does not have any data in my subforms, then (as you can expect) my subform controls disappear.

My subforms have "Allow Additions" set to YES.

The subform tables are linked through a LEFT JOIN.

I would like the controls to stay visible even when there are no records in the subforms.

I tried to set the subforms ID to the main forms ID thinking that this will at least generate an autonumber to make the subforms controls visible, but it did not work

=[Forms]![frmCandidateInfo]![CandidateID].[Value]

View 2 Replies View Related

Forms :: Calculated Control Value Appears But Disappears

Nov 7, 2013

I have a calculated control on a form that is summing other controls and then a subtotal on a subform. This is access 2007

The calculated control does not display the value until I enter a value other then the default in all of the source controls. If I hit the "refresh" button, the value appears in the calculated control for a moment, then disappears.

I have set the default of the source controls to be 0, so none are null.

the calc control value does not stay until I put a value in the subform and its subtotal thus has a value

View 5 Replies View Related

Reports :: Data Disappears In Report View

Sep 5, 2013

I have two related issues with reports. That is the data shows in report view and then disappears. The first is the simplest. I have a report that has a query recordsource and I calculate totals and populate the report in the OnLoad event using VBA code. This displays perfectly in "report view" and prints or exports fine. My issue is that after the print or export, the report has no data in my fields in "report view". It is like it is reloading the report without invoking the OnLoad event. When I close the report and re-open in report view, everything is fine again until I print.

The second issue is related. I have another report that is a bit more complicated. Due to the number of controls (I use many text boxes to display my calculations), I am using 3 subreports to get around the limitations in the number of controls. In report view, the report looks fine, but when I scroll down to the bottom and then back up, the text boxes in the subreport sections are empty. The parts of the report not in subreports is fine. By using "Msgboxes" in events, I discovered that when I scroll down, the subreports close, then re-open when I scroll back up. Again, due to an Access limitation of 22 inches per section, the I placed the subreports in the "report Header" section. It appears that my problem occurs when I scroll down to the "detail" section of the main report.

View 14 Replies View Related

Queries :: SQL Code Disappears From Query When Sending EMail

Jan 15, 2015

I have a simple SQL query that is e-mailed when there are >0 records. Fairly consistently, the SQL code in the query is wiped out and the query fails. It happens consistently to this query, even though I have many similar queries. I am running Access 2013 in Windows 7

SELECT AR.[Inv#], [History Header].[PO#], AR.[Customer Name],
AR.Date, AR.Mdse, AR.Freight, AR.Amount, AR.[Due Date]
FROM (AR INNER JOIN [History Header] ON AR.[Inv#] = [History Header].[Inv#(number)])
LEFT JOIN [Advanced Engineering Payment Reminder Sic]

[Code] ....

View 12 Replies View Related

General :: Popup Form Disappears On Multi Monitor

Mar 18, 2015

For example if I open up the Access database on my left monitor, then move it to my right - whenever I switch from design to form mode the form disappears. Moving Access back over to the left monitor will not show the form. Minimizing all windows except Access won't show it either. If I switch to layout view, then form view it will show on the monitor I have Access up on - but if I go back to Design and then form it will disappear again.

If I move Access to the left monitor (in this example). open the form in design and then form view it pops up visible. Seems clear that it ties the opening position of the popup to the monitor Access was opened on.

View 3 Replies View Related

Report Footer Textbox Disappears When Exported To Excel

Jul 21, 2014

I have a footer in my Report that contains subtotals. I'd like to add a textbox that says "Total" to my report, and although this label shows up when I view the report, it disappears if I export to Excel. How to prevent the label from disappearing when I export? (Attached a screenshot of my report's design.)

View 1 Replies View Related

Forms :: Default Text In Textbox That Disappears On Click (like A Search Box)?

Sep 26, 2014

Is there an efficient way to have default text in a textbox on my form (like a search box), but have it so that when a user focuses on the textbox (to type in a search term), the word should disappear.

Just like the search box on windows 7 start menu.

Then, is there a way to have the default text not be the actual text in the box? Otherwise, my search box will search the default text.

View 2 Replies View Related

Field Disappears When Make Table "Replicable" Selected

Mar 7, 2005

My database is replicated. When new fields are added to a table that is tagged as replicable, the field is there but not visible. (there are other fields that are visible) This affects queries based on the new fields as they do not show up in the query.

However, when I make the table non-replicable, I see all my previously hidden fields and of course my queries, query-based reports work fine.

Any suggestions? I've already run the compact & repair utility with no improvements.

Any help would be appreciated.

View 3 Replies View Related

Access 2003 Application Disappears During "open"

Jul 11, 2007

I am designing an application in Access 2003 and it's pretty much working now.

I have a main form set to automatically open (through database startup).

sometimes, access disappears before even showing the form. The ldb file remains in the folder and access does not show up in Tasks (so it's really terminated).

I do have On_Load event code in the form, but nothing drastic and I went through and made sure that all subs have Error Handlers.

It doesn't give me any error messages, just disappears. This also happens when I try opening the main form from the open Access app, but not as often.

Usually, if I open by holding Shift, enter the form in Design view and close it, it then opens no problem.

Any ideas? I searched and googled, but to no avail.

Thanks!

View 3 Replies View Related

Forms :: Access Form Disappears In Form View

Apr 3, 2014

I have a form that I can view in Design view and layout view just fine.

BUT --

If I just try to open the form in from view, it disappears somewhere even though it says it's open.

If I view it in Layout view first, then Form view, it shows.

I've removed any code behind to try and figure out what's going on but it still happens.

View 1 Replies View Related

Modules & VBA :: Delete Of A Record From A List Of Records In A Subform Deletes Wrong Record

Jun 28, 2013

When we browse through records in a subform we store the records in the database.When we want to delete a records for example the third record from the five records always the first records will be deleted. How can we delete the records where the cursor is at? When we are at the third record and press the delete button the third record from the list in the subform should be deleted.

Code:

Option Compare Database
Dim FocusBln As Boolean
Private Sub Identificeer()
Me.[Datum Aangemaakt].Visible = True
Me.[Datum Aangemaakt].SetFocus
If Me.[Datum Aangemaakt].Text = "" Then

[code]...

View 11 Replies View Related

Modules & VBA :: Running Update Query On Record And Have Form Show Updated Record

Jan 26, 2015

i want to be able to create an On Click Event when pushing a command button that will run an Update query to update a record and after it has been updated that specific record will pop up on a Form and be displayed. i know a different way is to run the Update query and then have it displayed in a Select query but i want it to be displayed on a Form instead. is it possible?

View 4 Replies View Related

Forms :: Double Click Event - Form Showing 1st Record Instead Of Selected Record

May 8, 2014

I am new to access and I recently encountered a double click issue

My form loads perfectly on double click event but it shows the first record instead of selected record.

My search is based on a PersonID but each PersonID has different WorkID that I wish to display on double click but it always shows the first WorkID instead of my selected record

I have tried changing the filters in the form properties but it still doesn't work for me.

Here's my code:

Private Sub SearchResults_DblClick(Cancel As Integer)
DoCmd.OpenForm "WorkForm", , , "[PersonID]=" & Me.[Searchresults], , acNormal
End Sub

[Searchresults] draws information from my Query

Query information:

PersonID... WorkID... Type......Location
1234..........1............Paint .....Address A
1234..........2............Electric...Address B
1234..........3............Floor..... Address C

View 7 Replies View Related

Forms :: Main Form Jumps Back To 1st Record When Moving To Next Record In Subform?

Mar 24, 2015

When I add a record in the subform and then move to the next record whilst still in the subform, the main form jumps back to its first record? I then have to move back to the right record in the main form to update the next record in the subform.

I want to move to the next record in the subform without affecting the main form.

View 1 Replies View Related

Forms :: Combo Box Search - If Record Not Exist It Will Display Msgbox To No Record Found

Oct 28, 2014

I have a problem with my database I have a combo box that will search for my record. Actually its working I input the specific number it goes to the specific record. But I want, if there no existing record in my database it will display a Messagebox that "No record Found" I try to put a code in a macro builder in a after update property field but nothing happened.

Expression code that it will display the msgbox if there's no record found.

the given code from macro builder is attached. I try to have an if else statement but I dont know how to not equal that giver conditional expression.

View 10 Replies View Related

Dynamically Update Field Of A Current Record Based On Previous Record

Apr 30, 2007

I need a way to dynamically store a particular value in "field_2" of the CURRENT record depending on whether or not the value of "field_1" of the CURRENT record is identical to the value of "field_1" of the PREVIOUS record within the same table. The table is sorted on "field_1".

So, if the value of "field_1" in the CURRENT record is "ABC" and the value of "field_1" in the PREVIOUS record is also "ABC", then store a value of "PPP" in "field_2" of the current record. IF on the other hand, the value of "field_1" in the CURRENT record is "ABC" and the value of "field_1" in the PREVIOUS record is "XYZ", then store a value of "WWW" in "field_2" of the current record.

I have a report that will use these results to count only the number of records that have a "WWW" in "field_2".

Is this doable, maybe in a query somehow?

I should add that whatever the solution, it needs to be compatible with Access 2000.

View 1 Replies View Related

Having A List Of Record Names Displayed And Opening The Full Record Via Click

Sep 13, 2005

Im not sure if this is the right place to put this but I was wondering if you could help me:

Say I have database with forms that display records or people ie name, address, postcode, etc. What I want to do is display a list of Names then from that list I can double, single click and open the record details.

Id call my self and amatuer at access and am probably guessing this is done via vscript or something else, but any help will do.

Thanks
Alex

View 14 Replies View Related

Forms :: How Move To Next Record After Fill Mask In First Record In Access Form

Jun 27, 2013

How move to next record (without enter) after fill mask in first record in access form?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved