26. juli 2002 - 01:26
Der er
16 kommentarer og
1 løsning
Dato tjek
Min lille formular på 2 (1.dag 2.måned) rullemenuer skal kunne søge i databasen om de to værdier ikke er der i forvejen(i samme række self.).
database tabellen ser således ud:
[Dag] [måned]
Alstå når man vælger den dato man nu ville have. skal man kunne trykke på en knap og så skal den kunne se i Databasen at de to værdier ik er der i for vejen . hvis de er der skal den komme med en tilmeldling på at der f.eks. ikke er plads den valgte dato[Dag/måned].
In the buttons ON CLICK event you could use the following
If DCOUNT("*", "TheTabelName", "Dag = " & Me.Dag " & " AND Måned = " Me.Måned ) > 0 Then
msgbox "Ikke er plads på den valgte dato[Dag/måned]!"
end if
If DCOUNT("*", "TheTabelName", "Dag = " & Me.Dag " & " AND Måned = " & Me.Måned ) > 0
ok jeg laver en database connection over min form og så sætter jeg det under knappens ONCLICK event ? ik ?
If you are entering data through BOUND fields (database connection) then you can place the code in the forms BEFORE UPDATE event. If It is an UNBOUND form then you can place the code in the buttons ON CLICK event.
cant u plz give a eksample of the code u are talking about .
send your dB to terry@santhell.dk and I will do it for you
database recieved and returned.
Form made and floowing code used
If DCount("*", "Dato", "Dag = " & Me.dag & " AND Maaned = " & Me.maaned) > 0 Then
MsgBox "Dag og måned findes ...."
Cancel = True
End If
28. juli 2002 - 10:29
#10
OK
28. juli 2002 - 17:03
#11
u only sendt the db...whers the asp file or the code file
28. juli 2002 - 17:05
#12
argghhh damn ! sorry i didnt say that it was to a asp site..damn sorry. i need in a webpage . Så den kan tjekke datoen i databasen og giv besked på en webside..
28. juli 2002 - 17:06
#13
like this..i want it to connect to a database and tjek if the date is in use when selectet from the drop down boxes
<form>
<select>
<option>Vælg Dag</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>30</option>
</select>
<select>
<option>Vælg måned</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
</form>
28. juli 2002 - 17:13
#14
No you didnt say it was ASP! i can NOT help you on the ASP only the Access (SQL)
You will need to make a SELECT
"SELECT Count(*) as Found from Dato WHERE Dag = " & SomeField & " AND maaned = " & SomeOtherField
Then the field namded Found will contain either 0 or 1
How you do that in ASP is up to you!
29. juli 2002 - 08:21
#15
affeafe>What are we going to do with this ?
29. juli 2002 - 08:25
#16
u get the points :(
29. juli 2002 - 08:27
#17
thanks, sorry if you cant use the solution!
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser