אקסס 2000, תיבה משולבת

Guy25

New member
אקסס 2000, תיבה משולבת

שלום לכל התותחים, אני מנסה לבצע הוספה (בעת שלא ברשימה) לתיבה משולבת התיבה המשולבת מוזנת משאילתה, אבל לאחר שהכנסתי את הנתון הוא אינו מתעדכן ואז אני חוזר על פעולת העדכון בעצם ללא סוף. אשמח לקבל עזרה.
 

חיון

New member
הנה ככה

הנה קוד (DAO) המוסיף ערך חדש לקומבו:
Private Sub City_NotInList(NewData As String, Response As Integer) ´ Add a new value to a combo box, for example to "Cities" ComboBox ´ First make sure you have a reference to DAO: ´ go to Tools > References and check "Microsoft DAO XXX Object library" Dim strMessage As String Dim dbsDB As Database Dim rstRS As Recordset ´ Ask the user whether to add a value to the list strMessage = "?האם ברצונך להוסיף את " & NewData & " לרשימה" If Confirm(strMessage) Then ´ Open the Cities table and add the NewData value Set dbsDB = CurrentDb() Set rstRS = dbsDB.OpenRecordSet("tblCities") rstRS.AddNew rstRS!CityName = NewData rstRS.Update Response = acDataErrAdded ´ Requery the list Else Response = acDataErrDisplay ´ Display the error End If End Sub Public Function Confirm(strMessage As String) As Boolean ´ Ask the user to confirm an action, returning True or False Dim bytChoice As Byte bytChoice = MsgBox(strMessage, vbQuestion + vbOKCancel) If bytChoice = vbOK Then Confirm = True Else Confirm = False End If End Function​
 
למעלה