This is my first post ever anywhere on this subject and this site. I am a noob. My Office database was created by an employee a while back. I've taught myself things by trial and error repeating things I see he did, such as adding fields and duplicating code lines to address the new fields. So I express, and apologize that I am far from a code writer.
But my issue is that I had finally changed from Office 97 to Office 2003 last year, and I've come across issues as I use my "converted" database. I've refrained from asking because of my inexperience.
I have removed the sendkeys "{Numlock}" to rid of another debugging issue found. (It was apparently no longer needed.)
The purpose of the name slug (which does show the name to be entered when I mouse-over) is to repopulate the initial part of the form with whom I edited.
Here is the whole command:
The last "DoEvents" is probably not necessary, I think it was for the numlock part.
The pic is what it's supposed to look like when it works right.
[/URL][/IMG]
But my issue is that I had finally changed from Office 97 to Office 2003 last year, and I've come across issues as I use my "converted" database. I've refrained from asking because of my inexperience.
DoCmd.GoToControl "cbx_NAME"
SendKeys NAME_SLUG
SendKeys "{ENTER}"
DoEvents
SendKeys "{NUMLOCK}"
I have removed the sendkeys "{Numlock}" to rid of another debugging issue found. (It was apparently no longer needed.)
The purpose of the name slug (which does show the name to be entered when I mouse-over) is to repopulate the initial part of the form with whom I edited.
Here is the whole command:
Please forgive me if I didn't post this correctly using "quote".Private Sub cb_FINAL_POST_EDITS_Click()
Dim L_NAME_HOLDER, F_NAME_HOLDER, E_mail_Holder, STREET1_HOLDER, STREET2_HOLDER, _
CITY_HOLDER, ST_HOLDER, ZIP_HOLDER, PH_HOLDER, PH_2_HOLDER, Account_Holder, Alt_HOLDER, _
PROMO_HOLDER As Variant ''''Ray added chb_dha
Dim MESSAGE, STYLE, TITLE, HELP, CONTEXT, RESPONSE As Variant
Dim DB As Database, RST1, RST2 As Recordset
Dim DB_REF_HOLDER, DB_REF_STRING, NAME_SLUG, FIND_DB_REF_STRING As Variant
L_NAME_HOLDER = tbx_LNAME.Value
F_NAME_HOLDER = tbx_FNAME.Value
E_mail_Holder = tbx_Email.Value
STREET1_HOLDER = tbx_STREET1.Value
STREET2_HOLDER = tbx_STREET2.Value
CITY_HOLDER = tbx_CITY.Value
ST_HOLDER = tbx_ST.Value
ZIP_HOLDER = tbx_ZIP.Value
PH_HOLDER = tbx_PH.Value
PH_2_HOLDER = tbx_PH_2.Value
Alt_HOLDER = tbx_ALT.Value
Account_Holder = tbx_Account.Value
PROMO_HOLDER = cbx_PROMO.Value
Set DB = CurrentDb
Set RST1 = DB.OpenRecordset("t_CUST_DATA1", dbOpenDynaset)
DB_REF_HOLDER = tbx_DB_REF.Value
FIND_DB_REF_STRING = "DB_REF_NO = " & DB_REF_HOLDER & ""
Set DB = CurrentDb
Set RST1 = DB.OpenRecordset("t_CUST_DATA1", dbOpenDynaset)
With RST1
.FindFirst FIND_DB_REF_STRING
.Edit
![L_NAME] = L_NAME_HOLDER
![F_NAME] = F_NAME_HOLDER
![E_mail] = E_mail_Holder
![STREET_1] = STREET1_HOLDER
![STREET_2] = STREET2_HOLDER
![CITY] = CITY_HOLDER
![ST] = ST_HOLDER
![ZIP] = ZIP_HOLDER
![PHONE] = PH_HOLDER
![PHONE_2] = PH_2_HOLDER
![ALT_ADDRESS] = Alt_HOLDER
![Acct] = Account_Holder
![PROMO_NAME] = PROMO_HOLDER
.Update
End With ''''RST1
NAME_SLUG = L_NAME_HOLDER & ", " & F_NAME_HOLDER
'''CLOSE FORM, RUN QUERY, OPEN FORM
'''FILL cbx_ lookup with NEW ADD...
DoCmd.SetWarnings False
Application.Echo False
DoCmd.Close acForm, "fm_ADD_EDIT_CLIENT", acSaveNo
DoCmd.OpenQuery "q_mt_CUST_DATA2"
DoCmd.Close acQuery, "q_mt_CUST_DATA2", acSaveYes
DoCmd.OpenForm "fm_ADD_EDIT_CLIENT"
DoCmd.SetWarnings True
Application.Echo True
'''message box that new add was made...
MESSAGE = "Edited Fields Successfully Updated..."
STYLE = vbOKOnly
TITLE = "Edits Posted"
RESPONSE = MsgBox(MESSAGE, STYLE, TITLE)
''''SendKeys "{NUMLOCK}"
'''FILL cbx_ lookup with NEW ADD...
'''Const VK_NUMLOCK = &H90
DoCmd.GoToControl "cbx_NAME"
SendKeys NAME_SLUG
SendKeys "{ENTER}"
DoEvents
End Sub
The last "DoEvents" is probably not necessary, I think it was for the numlock part.
The pic is what it's supposed to look like when it works right.